An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/17707
Daniel64d0c6327489
diff --git a/kernel/model/assets.go b/kernel/model/assets.goindex f8ad2a0801..650e24bfb6 100644--- a/kernel/model/assets.go+++ b/kernel/model/assets.go@@ -922,24 +922,30 @@ func RenameAsset(oldPath, newName string) (newPath string, err error) {return}newAbsPath := filepath.Join(filepath.Dir(oldAbsPath), newName)- if err = filelock.Rename(oldAbsPath, newAbsPath); err != nil {- if err = filelock.Copy(oldAbsPath, newAbsPath); err != nil {+ filelock.Lock(oldAbsPath)+ if err = os.Rename(oldAbsPath, newAbsPath); err != nil {+ if err = gulu.File.Copy(oldAbsPath, newAbsPath); err != nil {+ filelock.Unlock(oldAbsPath)logging.LogErrorf("copy asset [%s] failed: %s", oldAbsPath, err)return}}+ filelock.Unlock(oldAbsPath)- if filelock.IsExist(filepath.Join(util.DataDir, oldPath+".sya")) {+ oldSya := filepath.Join(util.DataDir, oldPath+".sya")+ filelock.Lock(oldSya)+ if gulu.File.IsExist(oldSya) {// Rename the .sya annotation file when renaming a PDF asset https://github.com/siyuan-note/siyuan/issues/9390- oldSya := filepath.Join(util.DataDir, oldPath+".sya")newSya := filepath.Join(util.DataDir, newPath+".sya")- if err = filelock.Rename(oldSya, newSya); err != nil {- if err = filelock.Copy(oldSya, newSya); err != nil {+ if err = os.Rename(oldSya, newSya); err != nil {+ if err = gulu.File.Copy(oldSya, newSya); err != nil {+ filelock.Unlock(oldSya)logging.LogErrorf("copy PDF annotation [%s] failed: %s", oldPath+".sya", err)return}}}+ filelock.Unlock(oldSya)oldName := path.Base(oldPath)