An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:fire: The database-bound block no longer automatically adds to the database after being copied as a replica https://github.com/siyuan-note/siyuan/issues/12294
Daniel62bdaf9ec6b0
diff --git a/kernel/model/file.go b/kernel/model/file.goindex f3ed9f62fc..0cf674c4ca 100644--- a/kernel/model/file.go+++ b/kernel/model/file.go@@ -981,24 +981,14 @@ func DuplicateDoc(tree *parse.Tree) {}FlushTxQueue()- // 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959+ // 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {if !entering || !n.IsBlock() {return ast.WalkContinue}- avs := n.IALAttr(av.NodeAttrNameAvs)- for _, avID := range strings.Split(avs, ",") {- if !ast.IsNodeIDPattern(avID) {- continue- }-- AddAttributeViewBlock(nil, []map[string]interface{}{{- "id": n.ID,- "isDetached": false,- }}, avID, "", "", "", "", true, map[string]interface{}{})- ReloadAttrView(avID)- }+ n.RemoveIALAttr(av.NodeAttrNameAvs)+ n.RemoveIALAttr(av.NodeAttrViewNames)return ast.WalkContinue})returndiff --git a/kernel/model/transaction.go b/kernel/model/transaction.goindex 78c2f019a1..081bba9c1a 100644--- a/kernel/model/transaction.go+++ b/kernel/model/transaction.go@@ -1206,19 +1206,9 @@ func (tx *Transaction) doLargeInsert(previousID string) (ret *TxErr) {upsertAvBlockRel(insertedNode)- // 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959- avs := insertedNode.IALAttr(av.NodeAttrNameAvs)- for _, avID := range strings.Split(avs, ",") {- if !ast.IsNodeIDPattern(avID) {- continue- }-- AddAttributeViewBlock(tx, []map[string]interface{}{{- "id": insertedNode.ID,- "isDetached": false,- }}, avID, "", "", "", previousID, true, map[string]interface{}{})- ReloadAttrView(avID)- }+ // 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294+ insertedNode.RemoveIALAttr(av.NodeAttrNameAvs)+ insertedNode.RemoveIALAttr(av.NodeAttrViewNames)if ast.NodeAttributeView == insertedNode.Type {// 插入数据库块时需要重新绑定其中已经存在的块@@ -1394,19 +1384,9 @@ func (tx *Transaction) doInsert(operation *Operation) (ret *TxErr) {upsertAvBlockRel(insertedNode)- // 复制为副本时将该副本块插入到数据库中 https://github.com/siyuan-note/siyuan/issues/11959- avs := insertedNode.IALAttr(av.NodeAttrNameAvs)- for _, avID := range strings.Split(avs, ",") {- if !ast.IsNodeIDPattern(avID) {- continue- }-- AddAttributeViewBlock(tx, []map[string]interface{}{{- "id": insertedNode.ID,- "isDetached": false,- }}, avID, "", "", "", previousID, true, map[string]interface{}{})- ReloadAttrView(avID)- }+ // 复制为副本时移除数据库绑定状态 https://github.com/siyuan-note/siyuan/issues/12294+ insertedNode.RemoveIALAttr(av.NodeAttrNameAvs)+ insertedNode.RemoveIALAttr(av.NodeAttrViewNames)if ast.NodeAttributeView == insertedNode.Type {// 插入数据库块时需要重新绑定其中已经存在的块