{"record":{"id":"1cb5e5e4abf4a6f2","repo":"siyuan-note/siyuan","slug":"conf-language-393","errorCode":null,"errorMessage":"Conf.Language(393)","messagePattern":"Conf\\.Language\\(393\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/file.go","lineNumber":476,"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(393))\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":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/file.go#L458-L494","documentation":"ListDocTree rejects flashcard-deck listings (flashcard=true) against encrypted notebooks: flashcard spaced-repetition data is not supported on encrypted notebooks, so the call fails fast with Conf.Language(393), a localized message explaining this limitation.","triggerScenarios":"Calling the document-tree listing API with flashcard=true for a notebook whose ID is in the encrypted-box set (IsEncryptedBox(boxID) is true), e.g. from the flashcard panel requesting the deck's document list.","commonSituations":"User enables encryption on a notebook then opens the flashcard deck view; plugins or scripts enumerate flashcard docs without checking notebook encryption; sync brings an encrypted notebook into a workspace used with the flashcard feature.","solutions":["Do not pass flashcard=true when listing documents of an encrypted notebook","List the notebook's documents without the flashcard flag and filter client-side by block presence if needed","Move flashcard content to a non-encrypted notebook if deck-based listing is required","Check notebook encryption status before calling the flashcard listing path"],"exampleFix":"// before\nfetchPost(\"/api/filetree/listDocTree\", {notebook: boxID, flashcard: true}) // encrypted box\n// after\nif (!isEncryptedBox(boxID)) {\n  fetchPost(\"/api/filetree/listDocTree\", {notebook: boxID, flashcard: true})\n}","handlingStrategy":"validation","validationCode":"const isEncrypted = isEncryptedBox(boxID); // expose via app config/API when integrating\nif (flashcard && isEncrypted) {\n  // skip flashcard-flagged listing; list without flag instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await fetchPost(\"/api/filetree/listDocTree\", {notebook: boxID, flashcard: true});\n} catch (e) {\n  if (/393|加密|encrypted/i.test(e.msg ?? \"\")) {\n    return fetchPost(\"/api/filetree/listDocTree\", {notebook: boxID, flashcard: false});\n  }\n  throw e;\n}","preventionTips":["Check notebook encryption status before using flashcard features on its docs","Document to users that flashcard deck enumeration is unsupported on encrypted notebooks","Use flashcard:false for generic document listing"],"tags":["flashcard","encrypted-notebook","filetree"],"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"}