Do not copy file body into DB content when archiving a published post #73
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 2.4.
bDS2:
../bDS2/lib/bds/posts.exarchive_post(~line 353) only sets status/updated_at. Content stays NULL for published→archived posts; the body is restored from file only on unarchive (restore_content_for_unarchive).Current behaviour (RuDS):
crates/bds-core/src/engine/post.rsarchive_post(~line 328) reads the .md body back intopost.contentand persists it when archiving a published post. The archived row then has body in the DB AND on disk — a DB state bDS2 never produces. This skews metadata_diff (content field comparisons) and rebuild expectations, and violates the project rule that body-in-DB is for drafts.Task: Remove the content-restore from
archive_post(keep it in the unarchive path — see companion issue "Add explicit unarchive"). Verify metadata_diff and generation treat archived-with-file posts identically to bDS2 afterwards.Acceptance: Test: publish → archive → DB content is NULL, file untouched; unarchive restores content. Depends on the unarchive issue landing first or together.
Implemented and pushed in
89a07c8. Archiving now changes only status/updated_at, preserves published file bytes exactly, and keeps published body content NULL in SQLite. Dedicated coverage verifies publish→archive persistence, metadata-diff status/timestamp drift, exclusion from generation sources, and unarchive restoration. Added Archive/Unarchive to the editor Quick Actions in the bDS2 location with complete localization and safe pending-editor persistence; updated the Allium rule and README. Neutral review compared the issue, bDS2 archive/unarchive flow, and Allium obligations. Verification: allium check/analyse, cargo fmt/check/build/machete, focused archive/metadata/generation/UI/i18n tests, cargo test --workspace (green; 1 intentional model-download ignore), cargo bundle-macos, and real German release-bundle inspection. Also made the server task-snapshot test assert its named invariant so unrelated concurrent domain events cannot make the full suite flaky.