• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 46969238346
78%
main: 81%

Build:
Build:
LAST BUILD BRANCH: rewrite/main
DEFAULT BRANCH: main
Ran 02 Dec 2026 09:02PM UTC
Jobs 2
Files 322
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

02 Dec 2026 08:58PM UTC coverage: 77.855%. Remained the same
46969238346

push

github

web-flow
fix(relay): answer error when event rate limiter is unavailable (#1300) (#1346)

## Description

Updates the unavailable event rate limiter branch in
`crates/nostream-relay/src/handlers/event.rs` to reply `error: rate
limiter unavailable` (with no backoff) instead of `rate-limited: slow
down`, updates
`a_failing_event_limiter_limits_the_event_without_a_backoff` in
`crates/nostream-relay/tests/limits.rs` to assert both the OK frame and
the `error` rejection metric label, and corrects ADR 0004
(`docs/rewrite/decisions/0004-wire-transport.md`).

## Related Issue

Closes #1300

## Motivation and Context

In the capture (`src/handlers/event-message-handler.ts:136-144`), an
unavailable event rate limiter answers `error: rate limiter unavailable`
with no backoff so connected clients do not back off together for an
outage on the relay's side. Previously,
`crates/nostream-relay/src/handlers/event.rs:101` answered
`rate-limited: slow down`, and ADR 0004 stated that matched the capture.

`HandlerContext::send_ok` routes rejections through
`RelayMetrics::event_rejected`, so answering `error: rate limiter
unavailable` also records the rejection under
`nostream_events_rejected_total{reason="error"}` rather than
`rate-limited`.

## How Has This Been Tested?

- Updated `a_failing_event_limiter_limits_the_event_without_a_backoff`
in `crates/nostream-relay/tests/limits.rs` to assert
`["OK","<id>",false,"error: rate limiter unavailable"]`,
`events_rejected("error") == 1`, and `events_rejected("rate-limited") ==
0`.
- Ran the full `nostream-relay` test suite (`cargo test -p
nostream-relay`): **320 passed, 0 failed** across all 13 test targets
(`lib`, `config_defaults`, `connection`, `handlers`, `hidden_content`,
`limits`, `metrics`, `nip11`, `nip_vectors`, `strategies`, `transport`,
`ts_case_parity`, `wire_parity`).
- Ran formatting and linter checks:
  - `cargo fmt --all --check`
- `cargo clippy -p nostream-relay --all-targets --all-features -- -D
warnings`
- Strict wor... (continued)

4635 of 6495 branches covered (71.36%)

Branch coverage included in aggregate %.

10011 of 12317 relevant lines covered (81.28%)

749.24 hits per line

Coverage Regressions

Lines Coverage ∆ File
1
81.82
-3.03% src/utils/relay-probe/dns-probe.ts
Jobs
ID Job ID Ran Files Coverage
1 Unit - 46969238346.1 02 Dec 2026 09:03PM UTC 322
75.36
GitHub Action Run
2 Integration - 46969238346.2 02 Dec 2026 09:02PM UTC 322
32.46
GitHub Action Run
Source Files on build 46969238346
  • Tree
  • List 322
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46969238346
  • 70fe92e2 on github
  • Prev Build on rewrite/main (#46936313438)
  • Next Build on rewrite/main (#46992911997)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc