fix(relay): republish NIP-IA snapshot on idempotent archive retry - #4675
Open
santhiprakash wants to merge 1 commit into
Open
fix(relay): republish NIP-IA snapshot on idempotent archive retry#4675santhiprakash wants to merge 1 commit into
santhiprakash wants to merge 1 commit into
Conversation
- Problem: when archive/unarchive returns changed=false, the handler returned before publish_nipia_archival_list, so a retry after a transient snapshot publish failure could never repair the kind:13535 list. - Fix: on the unchanged path, skip delta publish but still republish the archival list snapshot derived from archived_identities. - Verification: cargo test -p buzz-relay identity_archive; cargo clippy -p buzz-relay -- -D warnings. Signed-off-by: Santhi Prakash <b.santhiprakash@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4617
Problem
When
handle_identity_archive_eventprocesses an archive/unarchive request whose target identity is already in the desired state,db.archive/db.unarchivereturnschanged = false(ON CONFLICT DO NOTHING). The handler returnedOk(())immediately — beforepublish_nipia_archival_listran.If a prior request successfully wrote
archived_identitiesbut the kind:13535 snapshot publish failed transiently, retrying the same archive/unarchive request reports success to the client while the authoritative snapshot is never republished. That failure mode is unrepairable by retry.This is distinct from #3848 (same-second
created_atcollision on the snapshot), which is addressed separately in #3954.Triage / Root cause
In
crates/buzz-relay/src/handlers/identity_archive.rs, the early return on!changedskipped both the delta publish and the archival-list snapshot. The snapshot is a pure function ofarchived_identities, so republishing it on the idempotent path is safe even when no state transition occurred.Fix
On
changed == false, skippublish_nipia_archived/publish_nipia_unarchived(no delta to describe) but still callpublish_nipia_archival_list.Verification
cargo test -p buzz-relay identity_archivecargo clippy -p buzz-relay -- -D warningsNotes / Risks