mirror of
https://github.com/PerpetualSoftware/pad.git
synced 2026-09-21 10:03:29 +00:00
1eb7fff757
Item-link queries that JOIN against `items` now also filter on `deleted_at IS NULL` for both source and target. This prevents `pad item related`, the lineage breadcrumb, and dashboard enrichment from surfacing dangling endpoints when one side has been archived. Affected queries in internal/store/items.go: - GetItemLinks (powers `pad item related`, lineage, dashboard) - GetItemLink (singular; fixed for consistency) - GetParentForItem (breadcrumb / lineage; archived parent reads as none) Other item_links queries already filtered on deleted_at; export.go deliberately keeps all rows for backup correctness — left unchanged. The link rows themselves are preserved on disk, so restoring a soft-deleted item resurrects its relationships automatically. Tests: - TestItemLinks_HidesSoftDeletedEndpoints — delete + restore round-trip on both source-side and target-side - TestGetParentForItem_HidesSoftDeletedParent — parent breadcrumb path Manually verified: PLAN + TASK with `implements` link, soft-delete the TASK, `pad item related <PLAN>` correctly returns no implementers.