Repository navigation
sdk: clean up interrupted reconciliation and fail rejected downloads - #1480
Closed
erskingardner wants to merge 4 commits into
Closed
erskingardner wants to merge 4 commits into
erskingardner wants to merge 4 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Retain both changelog entries while incorporating the merged COUNT and waiter fixes from upstream master.
yukibtc
added a commit
that referenced
this pull request
Sep 30, 2026
Replaces #1480 Co-authored-by: Yuki Kishimoto <yukikishimoto@protonmail.com> Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
Member
|
Thanks @erskingardner, I've cherry-picked, refined a couple of things, and merged at 381605f |
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.
Description
NIP-77 reconciliation can report success when a relay rejects a download REQ with CLOSED. Dropping or failing reconciliation can also leave its download subscription registered.
Add request-scoped cleanup that removes the download subscription and attempts CLOSE/NEG-CLOSE on interruption. Use a fresh subscription ID per download batch so late CLOSED replies cannot terminate the next batch. Track outstanding requested IDs within the current bounded batch and report rejection or premature closure as a sync failure.
Notes to the reviewers
This patch preserves the existing public result API. The separate partial-progress reporting API is deferred. Network cleanup is best effort after disconnection; unrelated subscriptions remain active. EOSE keeps its existing request-completion semantics.
The rejection and cancellation regression tests fail against the upstream sync implementation and pass with this patch. They cover rejection of the first and a later download batch, previously stored events surviving failure, and cancellation of a real pending download through the public API followed by delivery on an unrelated live subscription.
Validation:
just fmtand the completejust precommitpassed locally on the pinned toolchain, including SDK tests with default and local-relay features, the configured WASM checks, Clippy, and documentation checks.Additional tests distinguish an empty CLOSED after all requested events arrived from one that omits requested events.
Checklist
CHANGELOG.md(if applicable)