🐛 Data sync may cause data loss on Android 14 https://github.com/siyuan-note/siyuan/issues/10205

This commit is contained in:
Daniel 2024-01-21 21:27:50 +08:00
parent dfe8f1317c
commit c00dc1cc5c
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
13 changed files with 36 additions and 33 deletions

View file

@ -567,7 +567,7 @@ var boxLatestHistoryTime = map[string]time.Time{}
func (box *Box) recentModifiedDocs() (ret []string) {
latestHistoryTime := boxLatestHistoryTime[box.ID]
filepath.Walk(filepath.Join(util.DataDir, box.ID), func(path string, info fs.FileInfo, err error) error {
filelock.Walk(filepath.Join(util.DataDir, box.ID), func(path string, info fs.FileInfo, err error) error {
if nil == info {
return nil
}
@ -666,7 +666,7 @@ func indexHistoryDir(name string, luteEngine *lute.Lute) {
entryPath := filepath.Join(util.HistoryDir, name)
var docs, assets []string
filepath.Walk(entryPath, func(path string, info os.FileInfo, err error) error {
filelock.Walk(entryPath, func(path string, info os.FileInfo, err error) error {
if strings.HasSuffix(info.Name(), ".sy") {
docs = append(docs, path)
} else if strings.Contains(path, "assets"+string(os.PathSeparator)) {