Repository navigation
sdk: require correlated COUNT results and preserve waiter receive errors - #1478
Merged
yukibtc merged 1 commit intoSep 30, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Pull-Request: nostrdevkit#1478 Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc
force-pushed
the
codex/upstream-sdk-count-waiters
branch
from
September 30, 2026 14:06
81c7c64 to
5052026
Compare
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
COUNT can currently return zero when its notification receiver lags or closes without receiving a matching reply, and it subscribes after sending the request. Event OK and authentication waiters similarly replace receiver failures with a generic premature-exit error.
Subscribe before sending COUNT, require a matching response, fail promptly on relay disconnect or rejection, and attempt CLOSE after every terminal result while preserving the original request error. Propagate the broadcast receive cause from OK/authentication waiters so callers can distinguish lost confirmation from an explicit relay rejection. Existing public signatures remain unchanged.
Notes to the reviewers
Regression tests cover COUNT timeout and unrelated notifications, legitimate zero, unrelated COUNT/OK IDs, relay rejection, disconnection, timeout, and receiver lag/closure. Publication documentation explains that missing confirmation leaves acceptance unknown.
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.Checklist
CHANGELOG.md(if applicable)