{"record":{"id":"b610d66990d397a8","repo":"siyuan-note/siyuan","slug":"conf-language-390","errorCode":null,"errorMessage":"Conf.Language(390)","messagePattern":"Conf\\.Language\\(390\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/blockial.go","lineNumber":370,"sourceCode":"\tif oldAttrs[DocSortModeAttr] != newAttrs[DocSortModeAttr] && ast.NodeDocument == node.Type {\n\t\tcache.RemoveDocIALInBox(tree.Path, tree.Box)\n\t\tcache.PutDocIALInBox(tree.Path, tree.Box, newAttrs)\n\t}\n\tpushBlockAttrs(oldAttrs, node)\n\tpushDocSortModeChanged(oldAttrs, node, tree)\n\treturn\n}\n\nfunc setNodeAttrs0(node *ast.Node, nameValues map[string]string, boxID string) (oldAttrs map[string]string, err error) {\n\tif err = treenode.ValidateTabsAttrs(node, nameValues); nil != err {\n\t\treturn\n\t}\n\t// 加密笔记本不支持书签和标签（依赖全局 SQLite 聚合，加密笔记本是孤岛）\n\tif IsEncryptedBox(boxID) && boxID != \"\" {\n\t\tfor name := range nameValues {\n\t\t\tswitch strings.ToLower(name) {\n\t\t\tcase \"bookmark\", \"tags\":\n\t\t\t\terr = errors.New(fmt.Sprintf(Conf.Language(390), name))\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\toldAttrs = parse.IAL2Map(node.KramdownIAL)\n\tnewAttrsUnEsc := parse.IAL2MapUnEsc(node.KramdownIAL)\n\tfor name := range nameValues {\n\t\tif \"fold\" == strings.ToLower(name) {\n\t\t\tdelete(newAttrsUnEsc, \"heading-fold\")\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor name, value := range nameValues {\n\t\tvalue = util.RemoveInvalidRetainCtrl(value)\n\t\tvalue = strings.TrimSpace(value)\n\t\tlowerName := strings.ToLower(name)\n\t\t// 转换为小写再验证属性名","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/blockial.go#L352-L388","documentation":"setNodeAttrs0 rejects setting the 'bookmark' or 'tags' attribute (case-insensitive) on a block inside an encrypted notebook, returning Conf.Language(390): 'Encrypted notebooks do not support bookmarks and tags, please remove the %s attribute of this block first'. Encrypted notebooks are isolated islands without the global SQLite aggregation these attributes depend on.","triggerScenarios":"POST /api/attr/setBlockAttrs (also batchSetBlockAttrs, setNodeAttrs with tx, or any path like updateBoundBlockAvsAttribute / doRemoveAttrViewView that funnels into setNodeAttrs0) with nameValues containing key 'bookmark' or 'tags' (any casing) while the block's box is an encrypted box (IsBoxEncrypted(boxID)).","commonSituations":"Plugin or script bulk-setting custom+standard attributes across all notebooks, some encrypted; drag/drop or sync flows copying attrs into encrypted notebooks; attribute-view bound blocks trying to write tags.","solutions":["Remove the 'bookmark'/'tags' keys from the attribute map before calling when the target box is encrypted","Keep bookmark/tag workflows out of encrypted notebooks; use unencrypted notebooks for those blocks","Partition your batch by notebook: apply full attrs to normal notebooks, filtered attrs to encrypted ones","Check the box type first (e.g. via workspace notebook list / IsEncryptedBox semantics) and warn the user instead of failing"],"exampleFix":"// before\nawait fetchPost('/api/attr/setBlockAttrs', {id, attrs: {bookmark: 'b', custom: 'x'}});\n// after\nif (isEncryptedBox(boxOf(id))) delete attrs.bookmark, delete attrs.tags;\nawait fetchPost('/api/attr/setBlockAttrs', {id, attrs});","handlingStrategy":"validation","validationCode":"const FORBIDDEN = ['bookmark', 'tags'];\nfor (const k of Object.keys(attrs)) {\n  if (FORBIDDEN.includes(k.toLowerCase()) && isEncryptedBox(boxId)) delete attrs[k];\n}","typeGuard":"null","tryCatchPattern":"try { await setBlockAttrs(id, attrs); } catch (e) { if (/bookmark|tags/.test(String(e))) { delete forbiddenKeys(attrs); await setBlockAttrs(id, attrs); } else throw e; }","preventionTips":["Filter bookmark/tags keys when targeting encrypted notebooks","Check notebook encryption status before cross-notebook attr copy","Warn users that bookmarks/tags are unavailable in encrypted notebooks","Partition batch operations by notebook type"],"tags":["siyuan","encrypted-notebook","bookmark","tags","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}