Skip to content

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

:bug: Align remaining docIAL/blockIAL writers with box-aware cache keys #18200

Danieldcfee1e5d3f3
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go
index 067aac6b5c..9dc0f1cea8 100644
--- a/kernel/model/attribute_view.go
+++ b/kernel/model/attribute_view.go
@@ -3018,13 +3018,18 @@ func (tx *Transaction) doRemoveAttrViewView(operation *Operation) (ret *TxErr) {
if blockViewID == viewID {
attrs[av.NodeAttrView] = attrView.ViewID
node.AttributeViewType = string(view.LayoutType)
- oldAttrs, e := setNodeAttrs0(node, attrs, "")
+ // 镜像块节点未关联 tree,通过 blocktree 解析 boxID 以走加密笔记本守卫与 box-aware 缓存键
+ boxID := ""
+ if bt := treenode.GetBlockTree(node.ID); nil != bt {
+ boxID = bt.BoxID
+ }
+ oldAttrs, e := setNodeAttrs0(node, attrs, boxID)
if nil != e {
logging.LogErrorf("set node attrs failed: %s", e)
continue
}
- cache.PutBlockIAL(node.ID, parse.IAL2Map(node.KramdownIAL))
+ cache.PutBlockIALInBox(node.ID, boxID, parse.IAL2Map(node.KramdownIAL))
pushBlockAttrs(oldAttrs, node)
}
}
diff --git a/kernel/model/index.go b/kernel/model/index.go
index 8052ba5155..34ccb49db8 100644
--- a/kernel/model/index.go
+++ b/kernel/model/index.go
@@ -184,7 +184,7 @@ func indexBox(boxID string) {
avNodes = append(avNodes, tree.Root.ChildrenByType(ast.NodeAttributeView)...)
lock.Unlock()
- cache.PutDocIAL(file.path, docIAL)
+ cache.PutDocIALInBox(file.path, tree.Box, docIAL)
treenode.IndexBlockTree(tree)
sql.IndexTreeQueue(tree)
util.IncBootProgress(bootProgressPart, fmt.Sprintf(Conf.Language(92), util.ShortPathForBootingDisplay(tree.Path)))