Skip to content

sdk: require correlated COUNT results and preserve waiter receive errors - #1478

Merged
yukibtc merged 1 commit into
nostrdevkit:masterfrom
erskingardner:codex/upstream-sdk-count-waiters
Sep 30, 2026
Merged

yukibtc merged 1 commit into
nostrdevkit:masterfrom
erskingardner:codex/upstream-sdk-count-waiters

Conversation

@erskingardner

@erskingardner erskingardner commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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 fmt and the complete just precommit passed locally on the pinned toolchain, including SDK tests with default and local-relay features, the configured WASM checks, Clippy, and documentation checks.

Checklist

  • I followed the contribution guidelines
  • I updated the relevant CHANGELOG.md (if applicable)
  • I understand and can explain all code in this PR

@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

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
yukibtc force-pushed the codex/upstream-sdk-count-waiters branch from 81c7c64 to 5052026 Compare September 30, 2026 14:06
@yukibtc
yukibtc merged commit 5052026 into nostrdevkit:master Sep 30, 2026
42 checks passed
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.

2 participants