Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: 云端同步发生冲突时生成副本 https://github.com/siyuan-note/siyuan/issues/5687

Liang Dingb846e3d1b18b
diff --git a/kernel/go.mod b/kernel/go.mod
index ef3d0a6e3f..ff274b368a 100644
--- a/kernel/go.mod
+++ b/kernel/go.mod
@@ -38,7 +38,7 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/qiniu/go-sdk/v7 v7.13.0
github.com/radovskyb/watcher v1.0.7
- github.com/siyuan-note/dejavu v0.0.0-20220821042432-9a0649a3cf06
+ github.com/siyuan-note/dejavu v0.0.0-20220821052517-f8edbabd0423
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f
github.com/siyuan-note/filelock v0.0.0-20220720144616-011221f7e128
diff --git a/kernel/go.sum b/kernel/go.sum
index b5b57c7da8..6beaad897a 100644
--- a/kernel/go.sum
+++ b/kernel/go.sum
@@ -349,8 +349,8 @@ github.com/shurcooL/reactions v0.0.0-20181006231557-f2e0b4ca5b82/go.mod h1:TCR1l
github.com/shurcooL/sanitized_anchor_name v0.0.0-20170918181015-86672fcb3f95/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
github.com/shurcooL/users v0.0.0-20180125191416-49c67e49c537/go.mod h1:QJTqeLYEDaXHZDBsXlPCDqdhQuJkuw4NOtaxYe3xii4=
github.com/shurcooL/webdavfs v0.0.0-20170829043945-18c3829fa133/go.mod h1:hKmq5kWdCj2z2KEozexVbfEZIWiTjhE0+UjmZgPqehw=
-github.com/siyuan-note/dejavu v0.0.0-20220821042432-9a0649a3cf06 h1:v6Sacjqh/Q3IMZvFDCYzXTBPS/fQs5A2pN2SQHXtY88=
-github.com/siyuan-note/dejavu v0.0.0-20220821042432-9a0649a3cf06/go.mod h1:/7pAviNPlpJiwZkEg2eyLTEq2/8sfW/AU4eHBvyrHFk=
+github.com/siyuan-note/dejavu v0.0.0-20220821052517-f8edbabd0423 h1:isIyTU/P59uEY9Teol3F55Va0NWrcMF1cbu+LqyEkY8=
+github.com/siyuan-note/dejavu v0.0.0-20220821052517-f8edbabd0423/go.mod h1:/7pAviNPlpJiwZkEg2eyLTEq2/8sfW/AU4eHBvyrHFk=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
github.com/siyuan-note/eventbus v0.0.0-20220624162334-ca7c06dc771f h1:JMobMNZ7AqaKKyEK+WeWFhix/2TDQXgPZDajU00IybU=
diff --git a/kernel/model/repository.go b/kernel/model/repository.go
index 17a63157e7..6186cb046d 100644
--- a/kernel/model/repository.go
+++ b/kernel/model/repository.go
@@ -568,7 +568,7 @@ func syncRepo(boot, exit, byHand bool) (err error) {
}
}
- if 1 > len(mergeResult.Upserts) && 1 > len(mergeResult.Removes) { // 没有数据变更
+ if 1 > len(mergeResult.Upserts) && 1 > len(mergeResult.Removes) && 1 > len(mergeResult.Conflicts) { // 没有数据变更
syncSameCount++
if 10 < syncSameCount {
syncSameCount = 5