{"record":{"id":"05beb1c8c4522b66","repo":"siyuan-note/siyuan","slug":"conf-language-313-05beb1","errorCode":null,"errorMessage":"Conf.Language(313)","messagePattern":"Conf\\.Language\\(313\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":461,"sourceCode":"\t}\n\n\tsortMode = Conf.FileTree.Sort\n\tboxConf := box.GetConf()\n\tif util.SortModeFileTree != boxConf.SortMode {\n\t\tsortMode = boxConf.SortMode\n\t}\n\treturn\n}\n\nfunc ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden bool, maxListCount int) (ret []*File, totals int, err error) {\n\t//os.MkdirAll(\"pprof\", 0755)\n\t//cpuProfile, _ := os.Create(\"pprof/cpu_profile_list_doc_tree\")\n\t//pprof.StartCPUProfile(cpuProfile)\n\t//defer pprof.StopCPUProfile()\n\n\tret = []*File{}\n\tif flashcard && IsEncryptedBox(boxID) {\n\t\treturn nil, 0, errors.New(Conf.Language(313))\n\t}\n\n\tvar deck *riff.Deck\n\tvar deckBlockIDs []string\n\tif flashcard {\n\t\tdeck = Decks[builtinDeckID]\n\t\tif nil == deck {\n\t\t\treturn\n\t\t}\n\n\t\tdeckBlockIDs = deck.GetBlockIDs()\n\t}\n\n\tbox := Conf.Box(boxID)\n\tif nil == box {\n\t\treturn nil, 0, errors.New(Conf.Language(0))\n\t}\n","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/8641553a1f07374001902d3ce773285db1292b2d/kernel/model/file.go#L443-L479","documentation":"ListDocTree rejects flashcard-focused listing requests on encrypted notebooks: if the flashcard flag is set and IsEncryptedBox(boxID) is true, it returns Conf.Language(313) ('Encrypted notebooks do not support this operation'). Encrypted notebooks deliberately do not expose deck/flashcard listing.","triggerScenarios":"Calling ListDocTree with flashcard=true for a boxID that belongs to an encrypted notebook, e.g. opening the flashcard dock/list for documents inside an encrypted notebook.","commonSituations":"User enabling the flashcard listing UI while browsing an encrypted notebook; plugins or scripts requesting flashcard doc trees without checking IsEncryptedBox first.","solutions":["Do not request flashcard doc trees for encrypted notebooks; check IsEncryptedBox(boxID) before calling with flashcard=true.","List the doc tree with flashcard=false for encrypted notebooks.","Unlock the encrypted notebook via its supported unlock flow if flashcard operations are required."],"exampleFix":"// before\nawait listDocTree(boxId, path, true /* flashcard */);\n// after\nif (!isEncryptedBox(boxId)) await listDocTree(boxId, path, true);\nelse await listDocTree(boxId, path, false);","handlingStrategy":"validation","validationCode":"if (isEncryptedBox(boxId) && flashcard) {\n  // encrypted notebooks do not support flashcard listing\n  return listDocTree(boxId, path, false);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await listDocTree(boxId, path, true);\n} catch (e) {\n  if (String(e.msg).includes('do not support')) {\n    await listDocTree(boxId, path, false);\n  }\n}","preventionTips":["Gate flashcard UI features on notebook encryption state","Educate users that flashcard listing is unavailable inside encrypted notebooks"],"tags":["encrypted-notebook","flashcards","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"8641553a1f07374001902d3ce773285db1292b2d","analyzedAt":"2026-09-11T16:08:28.414Z","contentChangedAt":"2026-09-11T16:08:28.414Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}