PhoenixKitCatalogue. Catalogue. AttributeSets. OrphanPruner
(PhoenixKitCatalogue v0.19.1)
Copy Markdown
View Source
Subscribes to entities blueprint lifecycle events and prunes item attachments whose set blueprint was deleted out from under them — the "suspenders" to the delete guard's "belt" (the guard refuses deleting attached sets; this cleans up after deletes that bypassed it, e.g. repo-level operations or a host that never registered the guard). The design doc always claimed this subscriber; the 2026-08-18 panel review noticed it was never actually wired.
Deliberately NOT a boot-time sweep: pruning consults get_set/1,
and sweeping while entities is disabled or mid-migration would read
every set as missing. prune_orphan_attachments/1 guards on
enablement for the same reason. The trade-off: a blueprint deleted
while the catalogue app was DOWN is never pruned automatically —
the residue is invisible rows (resolve_for_items/2 skips
unresolvable sets), recoverable by calling
AttributeSets.prune_orphan_attachments/1 with the deleted uuid.
Summary
Functions
Returns a specification to start this module under a supervisor.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()