🐛 Notebook data may be corrupted during data synchronization https://github.com/siyuan-note/siyuan/issues/9594

This commit is contained in:
Daniel 2023-11-06 22:13:04 +08:00
parent a721bbe6f0
commit 70c56c8e25
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
24 changed files with 88 additions and 96 deletions

View file

@ -27,6 +27,7 @@ import (
"github.com/88250/lute/ast"
"github.com/88250/lute/parse"
"github.com/Masterminds/sprig/v3"
"github.com/siyuan-note/filelock"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/av"
"github.com/siyuan-note/siyuan/kernel/treenode"
@ -183,7 +184,7 @@ func GetBlockAttributeViewKeys(blockID string) (ret []*BlockAttributeViewKeys) {
func RenderAttributeView(avID string) (viewable av.Viewable, attrView *av.AttributeView, err error) {
waitForSyncingStorages()
if avJSONPath := av.GetAttributeViewDataPath(avID); !gulu.File.IsExist(avJSONPath) {
if avJSONPath := av.GetAttributeViewDataPath(avID); !filelock.IsExist(avJSONPath) {
attrView = av.NewAttributeView(avID)
if err = av.SaveAttributeView(attrView); nil != err {
logging.LogErrorf("save attribute view [%s] failed: %s", avID, err)