revert: remove wsAuthFailureResponse (#149)#156
Merged
Conversation
Reverts the WebSocket auth failure signalling introduced in #149. The wsAuthFailureResponse pattern (accept + close + return 101) causes CF Workers to throw an unhandled "Network connection lost." runtime exception for every 401/403 on a WebSocket upgrade — ~15k exceptions per 30 minutes in production. Three fix attempts (addEventListener, send-before-close, both combined) all failed; the CF runtime throws at the native level before any JS handler can intercept it. Restoring the pre-#149 behaviour: WebSocket upgrade auth failures return plain HTTP 401/403. The browser client sees close code 1006, same as before. Closes #149 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
chrischrischris
approved these changes
May 19, 2026
4 tasks
Collaborator
|
🎉 This PR is included in version 1.5.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reverts the WebSocket auth failure signalling introduced in #149.
The
wsAuthFailureResponsepattern (accept()+close()+ return 101) causes the CF Workers runtime to throw an unhandledError: Network connection lost.exception for every 401/403 on a WebSocket upgrade — ~15k exceptions per 30 minutes in production. Three fix attempts shipped as v1.5.1 and v1.5.2 (event listeners,send()beforeclose()) all failed; the exception is thrown at the native CF runtime level before any JS handler can intercept it.Restoring pre-#149 behaviour: WebSocket upgrade auth failures return plain HTTP 401/403. The browser client sees close code 1006, same as before #149.
Test plan
npm test— 123 passing, 100% statement coveragenpm run lint— cleanOutcome: exception+Network connection lost.count drops to near zero in Coralogix🤖 Generated with Claude Code