{"record":{"id":"23ba12f87525f395","repo":"siyuan-note/siyuan","slug":"conf-language-386","errorCode":null,"errorMessage":"Conf.Language(386)","messagePattern":"Conf\\.Language\\(386\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/import.go","lineNumber":338,"sourceCode":"\t}\n\n\tcontainsFlashcardAttrs := false\n\tast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {\n\t\tif entering && n.IsBlock() && n.IALAttr(NodeAttrRiffDecks) != \"\" {\n\t\t\tcontainsFlashcardAttrs = true\n\t\t\treturn ast.WalkStop\n\t\t}\n\t\treturn ast.WalkContinue\n\t})\n\tif !containsFlashcardAttrs {\n\t\treturn nil\n\t}\n\n\ttitle := tree.Root.IALAttr(\"title\")\n\tif \"\" == title {\n\t\ttitle = filepath.Base(sourcePath)\n\t}\n\treturn errors.New(fmt.Sprintf(Conf.Language(386), htmlstd.EscapeString(title)))\n}\n\n// importedBlockDocTitles 建立本次导入块 ID 到所属文档标题的映射，供闪卡卡片反查文档。\nfunc importedBlockDocTitles(trees map[string]*parse.Tree) map[string]string {\n\tret := map[string]string{}\n\tfor _, tree := range trees {\n\t\tif nil == tree || nil == tree.Root {\n\t\t\tcontinue\n\t\t}\n\t\ttitle := tree.Root.IALAttr(\"title\")\n\t\tast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {\n\t\t\tif entering && \"\" != n.ID {\n\t\t\t\tret[n.ID] = title\n\t\t\t}\n\t\t\treturn ast.WalkContinue\n\t\t})\n\t}\n\treturn ret","sourceCodeStart":320,"sourceCodeEnd":356,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/import.go#L320-L356","documentation":"checkEncryptedImportFlashcards rejects importing a document into an encrypted notebook when the document contains flashcard attributes (custom-riff-decks IAL). Encrypted notebooks are isolated islands: flashcard decks and scheduling depend on the global database, so import must be refused. The message (i18n key 386) names the offending document title so the user can remove its flashcards in the source notebook.","triggerScenarios":"Calling importSY/ImportSYNotebookBundle with a .sy.zip whose target notebook is encrypted, while any block in the imported document tree carries a non-empty custom-riff-decks IAL attribute.","commonSituations":"User exports a notebook containing spaced-repetition flashcards and imports it into an encrypted notebook; also hit in tests TestCheckEncryptedImportFlashcards and via importSY0 during notebook bundle import.","solutions":["Remove the flashcard attributes (custom-riff-decks IAL) from the document in the source notebook and re-export","Import into a non-encrypted notebook instead","Recreate the flashcards manually in the target notebook after import"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const hasFlashcards = (tree) => tree.blocks.some(b => b.attributes && b.attributes[\"custom-riff-decks\"]);\nif (targetNotebook.encrypted && hasFlashcards(parsedDoc)) {\n  throw new Error(`Document \"${parsedDoc.title}\" contains flashcards and cannot be imported into an encrypted notebook`);\n}","typeGuard":"const isEncryptedNotebook = (box) => typeof box === \"object\" && box !== null && box.encrypted === true;","tryCatchPattern":null,"preventionTips":["Strip custom-riff-decks attributes before exporting documents destined for encrypted notebooks","Check target notebook encryption before initiating an import","Keep flashcards in a dedicated non-encrypted notebook if you plan to migrate data"],"tags":["import","flashcards","encrypted-notebook","unsupported-operation"],"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"}