Skip to content

revert: remove wsAuthFailureResponse (#149)#156

Merged
kptdobe merged 1 commit into
mainfrom
revert/ws-auth-failure-response
May 19, 2026
Merged

revert: remove wsAuthFailureResponse (#149)#156
kptdobe merged 1 commit into
mainfrom
revert/ws-auth-failure-response

Conversation

@kptdobe
Copy link
Copy Markdown
Contributor

@kptdobe kptdobe commented May 19, 2026

Summary

Reverts the WebSocket auth failure signalling introduced in #149.

The wsAuthFailureResponse pattern (accept() + close() + return 101) causes the CF Workers runtime to throw an unhandled Error: 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() before close()) 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 coverage
  • npm run lint — clean
  • After deploy: verify Outcome: exception + Network connection lost. count drops to near zero in Coralogix

🤖 Generated with Claude Code

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>
@kptdobe kptdobe merged commit cf6ad46 into main May 19, 2026
5 checks passed
@kptdobe kptdobe deleted the revert/ws-auth-failure-response branch May 19, 2026 13:56
adobe-bot pushed a commit that referenced this pull request May 20, 2026
## [1.5.3](v1.5.2...v1.5.3) (2026-05-20)

### Bug Fixes

* **edge,shareddoc:** ws auth close via message listener + flush save deadlock ([#157](#157)) ([ed718ee](ed718ee))

### Reverts

* remove wsAuthFailureResponse ([#149](#149)) ([#156](#156)) ([cf6ad46](cf6ad46))
@adobe-bot
Copy link
Copy Markdown
Collaborator

🎉 This PR is included in version 1.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants