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: Limit the database title to 256 characters https://github.com/siyuan-note/siyuan/issues/15459
Daniel0d3a2479cbb1
diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.goindex ce2adcc52c..1dd7e9a53f 100644--- a/kernel/model/attribute_view.go+++ b/kernel/model/attribute_view.go@@ -2922,6 +2922,10 @@ func (tx *Transaction) setAttributeViewName(operation *Operation) (err error) {}attrView.Name = strings.TrimSpace(operation.Data.(string))+ attrView.Name = strings.ReplaceAll(attrView.Name, "\n", " ")+ if 256 < len(attrView.Name) {+ attrView.Name = gulu.Str.SubStr(attrView.Name, 256)+ }err = av.SaveAttributeView(attrView)_, nodes := tx.getAttrViewBoundNodes(attrView)diff --git a/kernel/model/attribute_view_fix.go b/kernel/model/attribute_view_fix.goindex c999567915..2712a16ead 100644--- a/kernel/model/attribute_view_fix.go+++ b/kernel/model/attribute_view_fix.go@@ -17,7 +17,9 @@package modelimport (+ "strings""time"+ "unicode/utf8""github.com/88250/gulu""github.com/88250/lute/ast"@@ -93,6 +95,13 @@ func checkAttrView(attrView *av.AttributeView, view *av.View) {}}+ // 截断超长的数据库标题 Limit the database title to 256 characters https://github.com/siyuan-note/siyuan/issues/15459+ if 256 < utf8.RuneCountInString(attrView.Name) {+ attrView.Name = strings.ReplaceAll(attrView.Name, "\n", " ")+ attrView.Name = gulu.Str.SubStr(attrView.Name, 256)+ changed = true+ }+if changed {av.SaveAttributeView(attrView)}