Skip to content

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

:art: Improve def block ref count https://github.com/siyuan-note/siyuan/issues/13879

Danieldb86447f0046
diff --git a/kernel/model/push_reload.go b/kernel/model/push_reload.go
index 86ec44bc40..680a0d31de 100644
--- a/kernel/model/push_reload.go
+++ b/kernel/model/push_reload.go
@@ -154,9 +154,8 @@ func refreshRefCount(rootID, blockID string) {
isDoc := bt.ID == bt.RootID
var rootRefIDs []string
var refCount, rootRefCount int
- var refIDs []string
+ refIDs := sql.QueryRefIDsByDefID(bt.ID, isDoc)
if isDoc {
- refIDs = sql.QueryRefIDsByDefID(bt.ID, isDoc)
rootRefIDs = refIDs
} else {
rootRefIDs = sql.QueryRefIDsByDefID(bt.RootID, true)