Skip to content

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

:art: Improve kernel stability https://github.com/siyuan-note/siyuan/issues/9912

Daniela41797da68d4
diff --git a/kernel/model/path.go b/kernel/model/path.go
index 67da750ef7..be9678ea68 100644
--- a/kernel/model/path.go
+++ b/kernel/model/path.go
@@ -95,7 +95,9 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
root = hpathBtMap[hp]
isNotLast := i < len(parts)-1
if nil == root {
- retID = ast.NewNodeID()
+ if "" == retID {
+ retID = ast.NewNodeID()
+ }
pathBuilder.WriteString(retID)
docP := pathBuilder.String() + ".sy"
if isNotLast {
@@ -116,7 +118,9 @@ func createDocsByHPath(boxID, hPath, content, parentID, id string /* id 参数
}
}
} else {
- retID = root.ID
+ if "" == retID {
+ retID = root.ID
+ }
pathBuilder.WriteString(root.ID)
if !isNotLast {
pathBuilder.WriteString(".sy")