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

cameri / nostream / 46197882440
81%

Build:
DEFAULT BRANCH: main
Ran 28 Nov 2026 10:44PM UTC
Jobs 2
Files 353
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

28 Nov 2026 10:41PM UTC coverage: 80.567% (+0.07%) from 80.496%
46197882440

push

github

web-flow
fix(notifications): cap the response a notification delivery will read (#1274)

Closes #1257.

The delivery worker POSTs a notification and never reads the answer, but
axios advertised every encoding it could decode, decompressed whatever a
receiver sent back and buffered the whole result. A receiver answering
with a small gzip body that decodes to hundreds of megabytes therefore
spent the worker's heap for a value nothing consumed.

## Change

`src/services/notification-channels.ts` builds every delivery's request
from one place:

- **`accept-encoding: identity`** — axios no longer invites a compressed
response.
- **`responseType: 'stream'`** — the body is never buffered or parsed. A
2xx settles the request as soon as the headers arrive.
- **`discardResponseBody`** — drains at most 8 KiB of that stream, then
drops the socket, so the heap stays flat and a normal small reply still
frees its socket cleanly. It carries its own 2 s deadline, because a
streamed response settles at its headers and spends axios's request
timeout before the drain starts.
- **Success is the status and only the status.** No response size can
turn a notification the receiver accepted into a `FAILED` row.

The request side is deliberately unbounded: a `settings.changed`
envelope carries the changed values, so a blacklist edit alone produces
a body past any small cap, and bounding it would drop deliveries that
work today.

## Why not a response byte cap

Issue #1257 suggested `maxContentLength`. A first cut did exactly that,
and review showed the flaw: the cap rejects the promise *after* the
receiver has accepted the POST, so the dispatcher records a delivered
notification as failed and the outbox retries it. Streaming with a
bounded drain bounds the heap without letting the response decide the
outcome.

## Why this differs from the other capped fetches

`src/utils/nip05.ts` and `src/utils/relay-probe/nip11-probe.ts` both cap
a response with `maxContentLength`, and they are right ... (continued)

6335 of 8479 branches covered (74.71%)

Branch coverage included in aggregate %.

40 of 41 new or added lines in 1 file covered. (97.56%)

12803 of 15275 relevant lines covered (83.82%)

709.69 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
87.3
16.19% src/services/notification-channels.ts
Jobs
ID Job ID Ran Files Coverage
1 Unit - 46197882440.1 28 Nov 2026 10:47PM UTC 353
78.58
GitHub Action Run
2 Integration - 46197882440.2 28 Nov 2026 10:44PM UTC 353
36.53
GitHub Action Run
Source Files on build 46197882440
  • Tree
  • List 353
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #46197882440
  • fd98457c on github
  • Prev Build on main (#46177345082)
  • Next Build on main (#46198618658)
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