{"record":{"id":"ba42644eb99ffd80","repo":"siyuan-note/siyuan","slug":"unsupported-attribute-view-key-type-s","errorCode":null,"errorMessage":"unsupported attribute view key type [%s]","messagePattern":"unsupported attribute view key type \\[(.+?)\\]","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view.go","lineNumber":7046,"sourceCode":"\t\t\t\tif \"\" == previousKeyID {\n\t\t\t\t\tview.Kanban.Fields = append(view.Kanban.Fields, &av.ViewKanbanField{BaseField: newField})\n\t\t\t\t} else {\n\t\t\t\t\tadded := false\n\t\t\t\t\tfor i, field := range view.Kanban.Fields {\n\t\t\t\t\t\tif field.ID == previousKeyID {\n\t\t\t\t\t\t\tview.Kanban.Fields = append(view.Kanban.Fields[:i+1], append([]*av.ViewKanbanField{{BaseField: newField}}, view.Kanban.Fields[i+1:]...)...)\n\t\t\t\t\t\t\tadded = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !added {\n\t\t\t\t\t\tview.Kanban.Fields = append(view.Kanban.Fields, &av.ViewKanbanField{BaseField: newField})\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tdefault:\n\t\treturn fmt.Errorf(\"unsupported attribute view key type [%s]\", keyType)\n\t}\n\n\terr = av.SaveAttributeView(attrView)\n\treturn\n}\n\nfunc (tx *Transaction) doUpdateAttrViewColTemplate(operation *Operation) (ret *TxErr) {\n\terr := updateAttributeViewColTemplate(operation)\n\tif err != nil {\n\t\treturn &TxErr{code: TxErrHandleAttributeView, id: operation.AvID, msg: err.Error()}\n\t}\n\treturn\n}\n\nfunc updateAttributeViewColTemplate(operation *Operation) (err error) {\n\tattrView, err := av.ParseAttributeView(operation.AvID)\n\tif err != nil {\n\t\treturn","sourceCodeStart":7028,"sourceCodeEnd":7064,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/251596fc0de2f9528c00c224252fd073a99973f4/kernel/model/attribute_view.go#L7028-L7064","documentation":"Thrown by AddAttributeViewKey's default switch case when operation.Typ (keyType) is not one of the recognized KeyType values (block, text, number, date, select, mSelect, url, email, phone, mAsset, template, created, updated, checkbox, relation, rollup, lineNumber). Unknown types are rejected so that no half-defined column is persisted.","triggerScenarios":"A typo in the keyType string (e.g. 'select-multi' instead of 'mSelect'); a future/legacy keyType the running kernel does not recognize; a plugin sending a custom type the kernel never enumerates.","commonSituations":"Version mismatch between frontend and kernel (newer frontend sending a type the older kernel lacks); copy-paste errors in scripts building add-column operations; a plugin extending the type vocabulary without kernel support.","solutions":["Send only KeyType values the running kernel enumerates; maintain a client-side whitelist synchronized with the kernel.","Upgrade the kernel (or downgrade the client) so the type vocabulary matches.","Double-check spelling/casing of the type string against av.KeyType constants."],"exampleFix":"// before\nAddAttributeViewKey(avID, blockID, keyID, name, 'multi-select', ...) // wrong token\n// after\nAddAttributeViewKey(avID, blockID, keyID, name, 'mSelect', ...) // correct KeyType","handlingStrategy":"type-guard","validationCode":"const KNOWN_KEY_TYPES = ['block','text','number','date','select','mSelect','url','email','phone','mAsset','template','created','updated','checkbox','relation','rollup','lineNumber']\nif (!KNOWN_KEY_TYPES.includes(op.type)) { /* reject before sending */ }","typeGuard":"type KeyType = 'block'|'text'|'number'|'date'|'select'|'mSelect'|'url'|'email'|'phone'|'mAsset'|'template'|'created'|'updated'|'checkbox'|'relation'|'rollup'|'lineNumber'\nfunction isKeyType(s: string): s is KeyType { return ['block','text','number','date','select','mSelect','url','email','phone','mAsset','template','created','updated','checkbox','relation','rollup','lineNumber'].includes(s) }","tryCatchPattern":null,"preventionTips":["Maintain a client-side whitelist of KeyType values synchronized with the kernel.","Validate the type string against the whitelist before enqueueing an add-column operation."],"tags":["attribute-view","add-column","unknown-type","validation"],"backgroundTag":null,"analyzedSha":"251596fc0de2f9528c00c224252fd073a99973f4","analyzedAt":"2026-08-12T21:18:37.123Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}