Skip to content

sdk: report receiver-local notification gaps - #1482

Closed
erskingardner wants to merge 2 commits into
nostrdevkit:masterfrom
erskingardner:codex/upstream-sdk-notification-gaps
Closed

erskingardner wants to merge 2 commits into
nostrdevkit:masterfrom
erskingardner:codex/upstream-sdk-notification-gaps

Conversation

@erskingardner

Copy link
Copy Markdown
Contributor

Notification streams currently skip broadcast lag silently, so a caller can continue receiving notifications without knowing its receiver missed some.

Add Client::notifications_with_gaps() and Relay::notifications_with_gaps(), returning NotificationUpdate items that distinguish a notification from receiver-local lag. Reception continues after a gap; the skipped count counts notifications, not unique events or missing subscription inventory. Existing notification APIs and enum variants keep their behavior.

Includes API documentation, changelog, a consumer example, and tests covering repeated overflow, independent fast/slow client and relay receivers, continued reception, shutdown/ban, creation after termination, dropping a receiver, and legacy stream behavior.

Validation: just precommit; stable workspace Clippy with all targets and warnings denied; stable all-feature SDK tests.

Add parallel client and relay notification streams that expose broadcast lag without changing existing notification enum variants. Keep receiver-local gap counts distinct from event coverage and preserve reception after a gap.

Cover paused and active loopback receivers, repeated overflow, closure, and shutdown. Document the legacy behavior and add a minimal consumer example.
@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!

yukibtc added a commit that referenced this pull request Oct 1, 2026
Introduce optional gap reporting in `NotificationStream`, allowing users to observe skipped notifications using `NotificationStream::with_gaps()` method.

Replaces #1482

Co-authored-by: Jeff Gardner <202880+erskingardner@users.noreply.github.com>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
yukibtc added a commit that referenced this pull request Oct 1, 2026
Introduce optional gap reporting in `NotificationStream`, allowing users to observe skipped notifications using `NotificationStream::with_gaps()` method.

Replaces #1482

Co-authored-by: Jeff Gardner <202880+erskingardner@users.noreply.github.com>
Signed-off-by: Yuki Kishimoto <yukikishimoto@protonmail.com>
Preserve fast-receiver lag and closure assertions while exercising unrelated EOSE handling. Remove redundant failure-only match arms that inflated the patch coverage miss count.
@yukibtc

yukibtc commented Oct 2, 2026

Copy link
Copy Markdown
Member

Replaced by #1489

@yukibtc yukibtc closed this Oct 2, 2026
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