Spec:specs/engine_side_effects.allium DeletePostSideEffects: "for media_link in post.linked_media: ensures MediaSidecarUpdated(media_link.media_id) — removes post from media sidecar's linkedPostIds". Media sidecars carry linkedPostIds (specs/frontmatter.allium MediaSidecar).
bDS2:../bDS2/lib/bds/posts.exdelete_post collects linked media ids first and calls sync_deleted_post_media_sidecar/1 (→ Media.sync_media_sidecar) for each after deletion.
Current behaviour (RuDS):crates/bds-core/src/engine/post.rsdelete_post (~line 474) deletes the post_media rows but never rewrites the affected media sidecars, so their linkedPostIds keep referencing the deleted post — a divergence metadata diff will surface, and rebuild-from-filesystem would resurrect dead links.
Task: In delete_post, capture media_ids from post_media (ordered per bDS2: sort_order, media_id) before deleting the rows, then after deletion rewrite each media's sidecar (engine/media.rs already has the sidecar writer — reuse whatever update_media uses). Check crates/bds-core/src/engine/post_media.rs link/unlink paths also keep sidecars in sync (spec: metadata must flush to filesystem).
Acceptance: Test: link media to post, publish (sidecar contains post id), delete post → sidecar no longer lists the post id.
**Source:** Audit section 2.8.
**Spec:** `specs/engine_side_effects.allium` DeletePostSideEffects: "for media_link in post.linked_media: ensures MediaSidecarUpdated(media_link.media_id) — removes post from media sidecar's linkedPostIds". Media sidecars carry `linkedPostIds` (`specs/frontmatter.allium` MediaSidecar).
**bDS2:** `../bDS2/lib/bds/posts.ex` `delete_post` collects linked media ids first and calls `sync_deleted_post_media_sidecar/1` (→ `Media.sync_media_sidecar`) for each after deletion.
**Current behaviour (RuDS):** `crates/bds-core/src/engine/post.rs` `delete_post` (~line 474) deletes the post_media rows but never rewrites the affected media sidecars, so their `linkedPostIds` keep referencing the deleted post — a divergence metadata diff will surface, and rebuild-from-filesystem would resurrect dead links.
**Task:** In `delete_post`, capture `media_id`s from post_media (ordered per bDS2: sort_order, media_id) before deleting the rows, then after deletion rewrite each media's sidecar (engine/media.rs already has the sidecar writer — reuse whatever `update_media` uses). Check `crates/bds-core/src/engine/post_media.rs` link/unlink paths also keep sidecars in sync (spec: metadata must flush to filesystem).
**Acceptance:** Test: link media to post, publish (sidecar contains post id), delete post → sidecar no longer lists the post id.
hugo
added the bug label 2026-07-20 19:43:59 +00:00
Implemented in 1cdc86b. Post deletion now captures linked media in deterministic sort-order/media-id order before removing associations, deletes the post, and rewrites every surviving media sidecar through a shared canonical media-sidecar writer. Link, unlink, media metadata updates, and media-file replacement now use that same writer, while a concurrently missing media record is ignored in parity with bDS2. Added a regression test covering a published post linked to multiple media items and preservation of another post's linkedPostIds, and updated the README. Verified with Allium check/analyse, cargo fmt --check, cargo check --workspace, cargo machete --with-metadata, cargo build --workspace, focused link/unlink/deletion tests, and cargo test --workspace (all passed; one intentional model-download test ignored).
Implemented in 1cdc86b. Post deletion now captures linked media in deterministic sort-order/media-id order before removing associations, deletes the post, and rewrites every surviving media sidecar through a shared canonical media-sidecar writer. Link, unlink, media metadata updates, and media-file replacement now use that same writer, while a concurrently missing media record is ignored in parity with bDS2. Added a regression test covering a published post linked to multiple media items and preservation of another post's linkedPostIds, and updated the README. Verified with Allium check/analyse, cargo fmt --check, cargo check --workspace, cargo machete --with-metadata, cargo build --workspace, focused link/unlink/deletion tests, and cargo test --workspace (all passed; one intentional model-download test ignored).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Source: Audit section 2.8.
Spec:
specs/engine_side_effects.alliumDeletePostSideEffects: "for media_link in post.linked_media: ensures MediaSidecarUpdated(media_link.media_id) — removes post from media sidecar's linkedPostIds". Media sidecars carrylinkedPostIds(specs/frontmatter.alliumMediaSidecar).bDS2:
../bDS2/lib/bds/posts.exdelete_postcollects linked media ids first and callssync_deleted_post_media_sidecar/1(→Media.sync_media_sidecar) for each after deletion.Current behaviour (RuDS):
crates/bds-core/src/engine/post.rsdelete_post(~line 474) deletes the post_media rows but never rewrites the affected media sidecars, so theirlinkedPostIdskeep referencing the deleted post — a divergence metadata diff will surface, and rebuild-from-filesystem would resurrect dead links.Task: In
delete_post, capturemedia_ids from post_media (ordered per bDS2: sort_order, media_id) before deleting the rows, then after deletion rewrite each media's sidecar (engine/media.rs already has the sidecar writer — reuse whateverupdate_mediauses). Checkcrates/bds-core/src/engine/post_media.rslink/unlink paths also keep sidecars in sync (spec: metadata must flush to filesystem).Acceptance: Test: link media to post, publish (sidecar contains post id), delete post → sidecar no longer lists the post id.
Implemented in
1cdc86b. Post deletion now captures linked media in deterministic sort-order/media-id order before removing associations, deletes the post, and rewrites every surviving media sidecar through a shared canonical media-sidecar writer. Link, unlink, media metadata updates, and media-file replacement now use that same writer, while a concurrently missing media record is ignored in parity with bDS2. Added a regression test covering a published post linked to multiple media items and preservation of another post's linkedPostIds, and updated the README. Verified with Allium check/analyse, cargo fmt --check, cargo check --workspace, cargo machete --with-metadata, cargo build --workspace, focused link/unlink/deletion tests, and cargo test --workspace (all passed; one intentional model-download test ignored).