Expand description
Resolving a document format: the tenant’s row, or the bundle’s default.
Two tiers answer “which app owns this content type, and how is it indexed”:
the tenant’s own doc_formats row, and the in-memory
crate::bundled_apps::BundledAppRegistry this build loaded from dist.
The tenant row always wins, whatever version either side states. A row
means the tenant deliberately installed something — usually a packaged app
whose code lives in a blob — so a backend upgrade shipping a newer bundled
manifest must never silently repoint it. Dropping the row
(DELETE /api/doc-formats/{content_type}) reverts to the bundled entry; there
is no way to suppress a bundled format outright, only to override it.
Every reader goes through here so the two tiers cannot drift apart. The
writer deliberately does not: put_doc_format’s claim check reads the tenant
row alone, because a bundled manifest is a default rather than a claim.
Structs§
- DocFormat
Cache - Resolved formats, keyed by
(tn_id, content_type).
Enums§
- Source
- Which tier a resolved format came from.
Functions§
- invalidate
- Drop one
(tn_id, content_type)entry. Call after every successful write todoc_formats, or aPUTdoes not take effect until restart. - new_
doc_ format_ cache - Build an empty
DocFormatCache, so the server crate can register one without takinglru/parking_lotdependencies of its own. - resolve
- The format that governs
content_typefor this tenant, if any. - resolve_
list - Every format in effect for this tenant: its own rows, plus each bundled entry no row overrides.