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: Keep attribute view spec at version 6 https://github.com/siyuan-note/siyuan/issues/18539
Daniel5f9be2cabbac
diff --git a/kernel/av/av_fix.go b/kernel/av/av_fix.goindex 4eec44bd98..7c718f325b 100644--- a/kernel/av/av_fix.go+++ b/kernel/av/av_fix.go@@ -24,7 +24,7 @@ import ("github.com/siyuan-note/siyuan/kernel/util")-const CurrentSpec = 7+const CurrentSpec = 6const MaxFilterNestingDepth = 3@@ -39,7 +39,6 @@ func UpgradeSpec(av *AttributeView) {upgradeSpec4(av)upgradeSpec5(av)upgradeSpec6(av)- upgradeSpec7(av)}func CheckSpec(av *AttributeView) (err error) {@@ -51,15 +50,6 @@ func CheckSpec(av *AttributeView) (err error) {return}-// upgradeSpec7 移除数据库级当前视图,当前视图由数据库块属性或调用上下文决定。-func upgradeSpec7(av *AttributeView) {- if 7 <= av.Spec {- return- }-- av.Spec = 7-}-// upgradeSpec6 将卡片和看板的预设尺寸转换为可连续调节的实际宽度和宽高比。func upgradeSpec6(av *AttributeView) {if 6 <= av.Spec {diff --git a/kernel/av/av_fix_test.go b/kernel/av/av_fix_test.goindex 653a39270a..60b1a44e6e 100644--- a/kernel/av/av_fix_test.go+++ b/kernel/av/av_fix_test.go@@ -56,14 +56,13 @@ func TestUpgradeSpec6CardConfiguration(t *testing.T) {}}-func TestUpgradeSpec7RemovesPersistedCurrentView(t *testing.T) {+func TestLegacyCurrentViewIsNotPersisted(t *testing.T) {attrView := &AttributeView{}if err := json.Unmarshal([]byte(`{"spec":6,"viewID":"legacy-view","views":[]}`), attrView); nil != err {t.Fatal(err)}- UpgradeSpec(attrView)- if 7 != attrView.Spec {- t.Fatalf("expected spec 7, got %d", attrView.Spec)+ if CurrentSpec != attrView.Spec {+ t.Fatalf("expected spec %d, got %d", CurrentSpec, attrView.Spec)}data, err := json.Marshal(attrView)if nil != err {diff --git a/kernel/av/av_search_test.go b/kernel/av/av_search_test.goindex 52e248d5da..a28e62bdd0 100644--- a/kernel/av/av_search_test.go+++ b/kernel/av/av_search_test.go@@ -48,7 +48,7 @@ func TestParseAttributeViewSearchInfo(t *testing.T) {t.Fatalf("unexpected second view: %+v", info.Views[1])}- if _, err = parseAttributeViewSearchInfo([]byte(`{"spec": 8}`)); err != ErrSpecTooNew {+ if _, err = parseAttributeViewSearchInfo([]byte(`{"spec": 7}`)); err != ErrSpecTooNew {t.Fatalf("expected newer spec error, got %v", err)}}