siyuan-note/siyuan · error

Conf.Language(393)

Error message

Conf.Language(393)

What it means

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.

Solutions

  1. Do not pass flashcard=true when listing documents of an encrypted notebook
  2. List the notebook's documents without the flashcard flag and filter client-side by block presence if needed
  3. Move flashcard content to a non-encrypted notebook if deck-based listing is required
  4. Check notebook encryption status before calling the flashcard listing path

Example fix

// before
fetchPost("/api/filetree/listDocTree", {notebook: boxID, flashcard: true}) // encrypted box
// after
if (!isEncryptedBox(boxID)) {
  fetchPost("/api/filetree/listDocTree", {notebook: boxID, flashcard: true})
}
Defensive patterns

Strategy: validation

Validate before calling

const isEncrypted = isEncryptedBox(boxID); // expose via app config/API when integrating
if (flashcard && isEncrypted) {
  // skip flashcard-flagged listing; list without flag instead
}

Try / catch

try {
  return await fetchPost("/api/filetree/listDocTree", {notebook: boxID, flashcard: true});
} catch (e) {
  if (/393|加密|encrypted/i.test(e.msg ?? "")) {
    return fetchPost("/api/filetree/listDocTree", {notebook: boxID, flashcard: false});
  }
  throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19). Data as JSON: /api/errors/1cb5e5e4abf4a6f2. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/file.go:476

	}

	sortMode = Conf.FileTree.Sort
	boxConf := box.GetConf()
	if util.SortModeFileTree != boxConf.SortMode {
		sortMode = boxConf.SortMode
	}
	return
}

func ListDocTree(boxID, listPath string, sortMode int, flashcard, showHidden bool, maxListCount int) (ret []*File, totals int, err error) {
	//os.MkdirAll("pprof", 0755)
	//cpuProfile, _ := os.Create("pprof/cpu_profile_list_doc_tree")
	//pprof.StartCPUProfile(cpuProfile)
	//defer pprof.StopCPUProfile()

	ret = []*File{}
	if flashcard && IsEncryptedBox(boxID) {
		return nil, 0, errors.New(Conf.Language(393))
	}

	var deck *riff.Deck
	var deckBlockIDs []string
	if flashcard {
		deck = Decks[builtinDeckID]
		if nil == deck {
			return
		}

		deckBlockIDs = deck.GetBlockIDs()
	}

	box := Conf.Box(boxID)
	if nil == box {
		return nil, 0, errors.New(Conf.Language(0))
	}

View on GitHub (pinned to 9f775e8a12)