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

decentraland / eth-connect / 28115754140

24 Jun 2026 03:39PM UTC coverage: 67.697% (+1.2%) from 66.46%
28115754140

push

github

web-flow
fix: release the response body on non-2xx HTTPProvider responses (#582)

HTTPProvider.sendAsync discarded the fetch Response on a non-2xx status without
reading its body. With native fetch (undici) and browser fetch the underlying
socket stays checked out until the body is consumed or cancelled, so error
responses (e.g. an RPC endpoint returning 429/5xx) leaked connections under load.
node-fetch's default non-keep-alive agent masked this previously.

Drain the body via text() before invoking the callback (releasing the connection
across all fetch implementations) and surface the server's error detail in the
thrown error, bounded to 512 chars and best-effort, so non-2xx failures carry
useful diagnostics instead of a bare status code. The 2xx path is unchanged (it
already consumes the body via json()).

Adds unit tests covering the drain, error-detail surfacing, cleanup-failure, and
success paths.

568 of 995 branches covered (57.09%)

Branch coverage included in aggregate %.

1293 of 1754 relevant lines covered (73.72%)

148.33 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.21
/src/providers/HTTPProvider.ts


Source Not Available

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