siyuan-note/siyuan · error

Conf.Language(313)

Error message

Conf.Language(313)

What it means

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.

Solutions

  1. Do not request flashcard doc trees for encrypted notebooks; check IsEncryptedBox(boxID) before calling with flashcard=true.
  2. List the doc tree with flashcard=false for encrypted notebooks.
  3. Unlock the encrypted notebook via its supported unlock flow if flashcard operations are required.

Example fix

// before
await listDocTree(boxId, path, true /* flashcard */);
// after
if (!isEncryptedBox(boxId)) await listDocTree(boxId, path, true);
else await listDocTree(boxId, path, false);
Defensive patterns

Strategy: validation

Validate before calling

if (isEncryptedBox(boxId) && flashcard) {
  // encrypted notebooks do not support flashcard listing
  return listDocTree(boxId, path, false);
}

Try / catch

try {
  await listDocTree(boxId, path, true);
} catch (e) {
  if (String(e.msg).includes('do not support')) {
    await listDocTree(boxId, path, false);
  }
}

Prevention

When it happens

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

Common situations: User enabling the flashcard listing UI while browsing an encrypted notebook; plugins or scripts requesting flashcard doc trees without checking IsEncryptedBox first.

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@8641553a1f (2026-09-11). Data as JSON: /api/errors/05beb1c8c4522b66. Report an issue: GitHub.

Appendix: source

Thrown at kernel/model/file.go:461

	}

	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(313))
	}

	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 8641553a1f)