fix(gateway): close stopping actor websockets#4916
Conversation
Review: fix(gateway): close stopping actor websocketsOverviewThis PR adds proper WebSocket close frames (instead of hard errors) when connecting to stopping or sleeping actors. Changes span three layers:
The intent is sound - browser clients cannot surface HTTP error codes on failed WebSocket upgrades and need close codes/reasons instead. This aligns with the CLAUDE.md WebSocket rejection policy. Issues1. Inconsistent close code: In 2. In if !is_hibernatable && (!callback_ctx.started() || callback_ctx.sleep_requested())But the 3. Guard-level In 4. Duplicate The function is defined identically in both 5. CLAUDE.md says not to reject WebSocket upgrades with HTTP status codes before the upgrade. The 503 path in Minor observations
|
36860a0 to
a362f40
Compare
979cd17 to
8bb1816
Compare
|
Closing again — going to redo this as a smaller change at the top of the stack that only fires on shutdown finalize (not during onSleep / onDestroy). |

Description
Please include a summary of the changes and the related issue. Please also include relevant motivation and context.
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Checklist: