Skip to content

fix(wintermute): retract notifications when their record is deleted - #227

Open
afbase wants to merge 1 commit into
mainfrom
fix/wintermute-notification-retraction
Open

fix(wintermute): retract notifications when their record is deleted#227
afbase wants to merge 1 commit into
mainfrom
fix/wintermute-notification-retraction

Conversation

@afbase

@afbase afbase commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Deleting a record left its notification rows behind. The appview's listNotifications gates on the subject's existence and never on the notified record's, so a notification outlives the like or repost that caused it and keeps rendering — while the unread count does gate on that record, so the badge and the list disagree. Deletes now remove notifications keyed on the removed record, matching the reference indexer's notifsForDelete.

Applies to every collection that produces notifications, so unlikes, un-reposts and unfollows all retract correctly.

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: retraction on like delete, and retraction on repost delete with the boilerplate record skip enabled
  • cargo llvm-cov -p rsky-wintermute
  • cargo build --release -p rsky-wintermute
  • Confirm an unliked post leaves no notification row and that the unread count matches the list afterwards
  • Size and clear the existing backlog of notification rows whose referenced record is already gone

Deleting a record left its notification rows in place. The appview's
listNotifications gates on the subject's existence and never on the notified
record's, so a notification outlives the like or repost that caused it and
keeps rendering; the unread count does gate on that record, so the badge and
the list disagree.

Delete notifications keyed on the removed record, matching the reference
indexer's notifsForDelete.
@afbase
afbase force-pushed the fix/wintermute-notification-retraction branch from 8a1bacf to a0ac6f5 Compare August 11, 2026 20:49
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