Skip to content

fix(wintermute): distinguish an absent record row from a stale delete - #226

Open
afbase wants to merge 1 commit into
fix/wintermute-notification-retractionfrom
fix/wintermute-delete-cascade
Open

fix(wintermute): distinguish an absent record row from a stale delete#226
afbase wants to merge 1 commit into
fix/wintermute-notification-retractionfrom
fix/wintermute-delete-cascade

Conversation

@afbase

@afbase afbase commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Builds on #223. The delete path treats "no record row deleted" as a lost race and skips the typed cleanup, so the typed row is orphaned whenever the record row is simply absent rather than newer. #223 works around that by forcing the cascade for the boilerplate collections (like, repost, follow, block), which fixes the common case but does it unconditionally: a delete carrying an older rev than a surviving record row now cascades into a live typed row, and the error from the record delete is discarded.

This returns the deletion outcome instead of a bool. An absent record row cascades; a surviving newer rev does not; and the distinction holds for every collection rather than only the boilerplate set. Practical exposure of the stale-rev case is small — rkeys are TIDs, so delete-then-recreate at the same key is rare — so this is a correctness cleanup rather than an urgent fix.

Stacked on #227; review that one first. Retarget to main once it merges.

Test plan

  • cargo clippy -p rsky-wintermute --all-targets is clean
  • cargo test -p rsky-wintermute --lib against a schema-loaded Postgres, including the two added cases: cascade with the skip off and the record row absent, and no cascade for a stale-rev delete with the skip on
  • cargo llvm-cov -p rsky-wintermute
  • cargo build --release -p rsky-wintermute
  • Confirm the stale-writes-skipped counter moves for a stale delete and stays flat for an absent record row

@afbase
afbase force-pushed the fix/wintermute-delete-cascade branch from a5dada6 to 6b9de47 Compare August 11, 2026 04:54
@afbase afbase changed the title fix(wintermute): cascade record deletes to typed tables and notifications fix(wintermute): distinguish an absent record row from a stale delete Aug 11, 2026
@afbase
afbase changed the base branch from main to fix/wintermute-notification-retraction August 11, 2026 04:54
@afbase
afbase force-pushed the fix/wintermute-notification-retraction branch from 8a1bacf to a0ac6f5 Compare August 11, 2026 20:49
The delete path treated "no record row deleted" as a lost race and skipped the
typed cleanup, which orphaned the typed row whenever the record row was simply
absent. The boilerplate skip works around that by forcing the cascade for
like, repost, follow and block, but it does so unconditionally: a delete
carrying an older rev than a surviving record row now cascades into a live
typed row, and the error from the record delete is discarded.

Return the deletion outcome instead. An absent record row cascades, a
surviving newer rev does not, and the distinction holds for every collection
rather than only the boilerplate set.
@afbase
afbase force-pushed the fix/wintermute-delete-cascade branch from 6b9de47 to fe1b32d Compare August 11, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant