Skip to main content

is_indexable

Function is_indexable 

Source
pub fn is_indexable(file: &FileView) -> bool
Expand description

Whether a file should have index rows at all.

Pure, so the rule is testable without an App, and shared: both this module’s 'F' row and crate::indexer’s deep 'D' parts have to agree, or the sweep would delete one and immediately rebuild the other.

A file in the trash is excluded alongside a deleted one — it is out of every listing, so a hit on it would deep-link nowhere.

Managed files are excluded too, and that one is a disclosure rule rather than a dead-link rule. crates/cloudillo-profile/src/media.rs caches every peer’s avatar into MANAGED_PARENT_ID as "<peer id_tag>-profile-pic.jpg" with visibility: Some('P'), so indexing them would let an unauthenticated /api/search enumerate the tenant’s whole contact graph out of the file names. GET /api/files drops managed files from every listing; search must not be wider than the listing it mirrors.

hidden is treated identically: it is the read-only legacy flag from the pre-managed-folder schema — rows a new write would place in MANAGED_PARENT_ID — so folding it in needs no new column and no migration. The cost is that those legacy rows stop being searchable even for the tenant owner; they stay reachable through GET /api/files.