Skip to content

Fix unbound ctx.onerror on streamed response Counter (PROD-84255) - #122

Merged
klesgidis merged 1 commit into
masterfrom
fix/prod-84255-unbound-ctx-onerror
Jul 28, 2026
Merged

Fix unbound ctx.onerror on streamed response Counter (PROD-84255)#122
klesgidis merged 1 commit into
masterfrom
fix/prod-84255-unbound-ctx-onerror

Conversation

@klesgidis

Copy link
Copy Markdown
Contributor

Summary

  • Client disconnect during a streamed response (no Content-Length) caused Counter to emit error with riviere's unbound ctx.onerror, throwing inside Koa's error handler and crashing the process. Bind the handler.
  • Regression test emits stream error with a non-arrow onerror. Latent since Calculate content length for responses when not available in header #44; exposed by Koa 3 Stream.pipeline after orka 5.2.0.
  • Bump to @workablehr/riviere@1.22.1.

Test plan

  • npm test — 113 passing
  • New regression test fails on unbound handler with TypeError: Cannot read properties of undefined (reading 'emit')
  • New regression test passes with the arrow-bound fix
  • After merge: tag v1.22.1 to trigger GitHub release + npm publish
  • In hris: bump @workablehr/riviere to ^1.22.1 and confirm Honeybadger fault 133034050 stops

Made with Cursor

Client disconnect during a streamed response (no Content-Length) caused
Counter to emit error with riviere's unbound ctx.onerror, throwing inside
Koa's error handler and crashing the process. Bind the handler and add a
regression test. Bump to 1.22.1.

Co-authored-by: Cursor <cursoragent@cursor.com>
@klesgidis
klesgidis merged commit b2a0876 into master Jul 28, 2026
7 checks passed
@klesgidis
klesgidis deleted the fix/prod-84255-unbound-ctx-onerror branch July 28, 2026 15:53
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.

1 participant