mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🐛 Block attributes are not refreshed after data syncing https://github.com/siyuan-note/siyuan/issues/11343
This commit is contained in:
parent
89c55026ab
commit
0f915df236
4 changed files with 21 additions and 2 deletions
4
kernel/cache/ial.go
vendored
4
kernel/cache/ial.go
vendored
|
|
@ -75,3 +75,7 @@ func GetBlockIAL(id string) (ret map[string]string) {
|
||||||
func RemoveBlockIAL(id string) {
|
func RemoveBlockIAL(id string) {
|
||||||
blockIALCache.Del(id)
|
blockIALCache.Del(id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ClearBlocksIAL() {
|
||||||
|
blockIALCache.Clear()
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import (
|
||||||
"github.com/facette/natsort"
|
"github.com/facette/natsort"
|
||||||
"github.com/siyuan-note/filelock"
|
"github.com/siyuan-note/filelock"
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
|
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||||
|
|
@ -503,6 +504,8 @@ func FullReindex() {
|
||||||
task.AppendTask(task.DatabaseIndexFull, fullReindex)
|
task.AppendTask(task.DatabaseIndexFull, fullReindex)
|
||||||
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
|
||||||
task.AppendTaskWithTimeout(task.DatabaseIndexEmbedBlock, 30*time.Second, autoIndexEmbedBlock)
|
task.AppendTaskWithTimeout(task.DatabaseIndexEmbedBlock, 30*time.Second, autoIndexEmbedBlock)
|
||||||
|
cache.ClearDocsIAL()
|
||||||
|
cache.ClearBlocksIAL()
|
||||||
task.AppendTask(task.ReloadUI, util.ReloadUI)
|
task.AppendTask(task.ReloadUI, util.ReloadUI)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,6 @@ import (
|
||||||
"github.com/siyuan-note/eventbus"
|
"github.com/siyuan-note/eventbus"
|
||||||
"github.com/siyuan-note/httpclient"
|
"github.com/siyuan-note/httpclient"
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
"github.com/siyuan-note/siyuan/kernel/cache"
|
|
||||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||||
"github.com/siyuan-note/siyuan/kernel/task"
|
"github.com/siyuan-note/siyuan/kernel/task"
|
||||||
|
|
@ -1475,7 +1474,6 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
|
||||||
syncingFiles = sync.Map{}
|
syncingFiles = sync.Map{}
|
||||||
syncingStorages.Store(false)
|
syncingStorages.Store(false)
|
||||||
|
|
||||||
cache.ClearDocsIAL() // 同步后文档树文档图标没有更新 https://github.com/siyuan-note/siyuan/issues/4939
|
|
||||||
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
if needFullReindex(upsertTrees) { // 改进同步后全量重建索引判断 https://github.com/siyuan-note/siyuan/issues/5764
|
||||||
FullReindex()
|
FullReindex()
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import (
|
||||||
"github.com/siyuan-note/dejavu"
|
"github.com/siyuan-note/dejavu"
|
||||||
"github.com/siyuan-note/dejavu/cloud"
|
"github.com/siyuan-note/dejavu/cloud"
|
||||||
"github.com/siyuan-note/logging"
|
"github.com/siyuan-note/logging"
|
||||||
|
"github.com/siyuan-note/siyuan/kernel/cache"
|
||||||
"github.com/siyuan-note/siyuan/kernel/conf"
|
"github.com/siyuan-note/siyuan/kernel/conf"
|
||||||
"github.com/siyuan-note/siyuan/kernel/filesys"
|
"github.com/siyuan-note/siyuan/kernel/filesys"
|
||||||
"github.com/siyuan-note/siyuan/kernel/sql"
|
"github.com/siyuan-note/siyuan/kernel/sql"
|
||||||
|
|
@ -306,6 +307,12 @@ func removeIndexes(removeFilePaths []string) (removeRootIDs []string) {
|
||||||
util.IncBootProgress(bootProgressPart, msg)
|
util.IncBootProgress(bootProgressPart, msg)
|
||||||
util.PushStatusBar(msg)
|
util.PushStatusBar(msg)
|
||||||
|
|
||||||
|
bts := treenode.GetBlockTreesByRootID(block.RootID)
|
||||||
|
for _, b := range bts {
|
||||||
|
cache.RemoveBlockIAL(b.ID)
|
||||||
|
}
|
||||||
|
cache.RemoveDocIAL(block.Path)
|
||||||
|
|
||||||
treenode.RemoveBlockTreesByRootID(block.RootID)
|
treenode.RemoveBlockTreesByRootID(block.RootID)
|
||||||
sql.RemoveTreeQueue(block.RootID)
|
sql.RemoveTreeQueue(block.RootID)
|
||||||
}
|
}
|
||||||
|
|
@ -347,6 +354,13 @@ func upsertIndexes(upsertFilePaths []string) (upsertRootIDs []string) {
|
||||||
}
|
}
|
||||||
treenode.IndexBlockTree(tree)
|
treenode.IndexBlockTree(tree)
|
||||||
sql.UpsertTreeQueue(tree)
|
sql.UpsertTreeQueue(tree)
|
||||||
|
|
||||||
|
bts := treenode.GetBlockTreesByRootID(tree.ID)
|
||||||
|
for _, b := range bts {
|
||||||
|
cache.RemoveBlockIAL(b.ID)
|
||||||
|
}
|
||||||
|
cache.RemoveDocIAL(tree.Path)
|
||||||
|
|
||||||
upsertRootIDs = append(upsertRootIDs, tree.Root.ID)
|
upsertRootIDs = append(upsertRootIDs, tree.Root.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue