{"record":{"id":"4cd91d7aa327967e","repo":"siyuan-note/siyuan","slug":"encrypted-notebook-attribute-view-snapshot-is-plai","errorCode":null,"errorMessage":"encrypted notebook attribute view snapshot is plaintext [%s]","messagePattern":"encrypted notebook attribute view snapshot is plaintext \\[(.+?)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/attribute_view_render.go","lineNumber":1503,"sourceCode":"\treturn\n}\n\nfunc decryptHistoricalAttributeView(boxID, avID string, data []byte) ([]byte, error) {\n\tciphertext := util.IsCiphertext(data)\n\tif boxID == \"\" {\n\t\tif ciphertext {\n\t\t\treturn nil, errors.New(\"encrypted attribute view snapshot is missing notebook context\")\n\t\t}\n\t\treturn data, nil\n\t}\n\tif !IsEncryptedBox(boxID) {\n\t\tif ciphertext {\n\t\t\treturn nil, fmt.Errorf(\"encrypted attribute view snapshot has no matching notebook [%s]\", boxID)\n\t\t}\n\t\treturn data, nil\n\t}\n\tif !ciphertext {\n\t\treturn nil, fmt.Errorf(\"encrypted notebook attribute view snapshot is plaintext [%s]\", boxID)\n\t}\n\treturn av.DecryptAVData(boxID, avID, data)\n}\n","sourceCodeStart":1485,"sourceCodeEnd":1507,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/attribute_view_render.go#L1485-L1507","documentation":"decryptHistoricalAttributeView enforces encryption consistency in the other direction: the notebook (boxID) is marked encrypted, but the snapshot attribute view file is plaintext. An encrypted notebook must never contain plaintext AV snapshots, so the kernel rejects the data rather than silently accepting an inconsistent (possibly corrupted or tampered) snapshot.","triggerScenarios":"Viewing history of an attribute view under an encrypted notebook where the snapshot file storage/av/<avID>.json was written as plaintext — e.g. produced by a kernel version or tool that skipped encryption, or the file was copied from a plain notebook into an encrypted notebook's history directory.","commonSituations":"Mixed-version histories after upgrading encryption support; scripts or sync tools copying raw .json AV files between plain and encrypted notebooks; partially restored backups where only some files were encrypted.","solutions":["Copy the correct encrypted snapshot file into the history directory (verify it is ciphertext) or regenerate the snapshot from the encrypted notebook.","Check for mixed-version restore artifacts and rebuild history from the source notebook.","Verify the notebook's encryption flag is intentional; if the notebook should be plain, fix the flag consistency at the notebook level rather than editing the snapshot.","Follow the encrypted-notebook compatibility rules in docs/ENCRYPTED-NOTEBOOK.md; never hand-edit ciphertext."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  await renderHistoryAttributeView(avID, created);\n} catch (e) {\n  if (String(e.msg).startsWith(\"encrypted notebook attribute view snapshot is plaintext\")) {\n    // regenerate the history snapshot from the encrypted notebook; do not hand-edit files\n  }\n}","preventionTips":["Restore backups wholesale, not file-by-file, to avoid mixed encrypted/plaintext snapshots","Use the same kernel version for writing and reading encrypted history snapshots"],"tags":["go","encryption","attribute-view","integrity"],"backgroundTag":"checksum-mismatch","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"}