fix(websocket): add close reasons and suppress noisy warnings#4476
Open
NathanFlurry wants to merge 1 commit intomainfrom
Open
fix(websocket): add close reasons and suppress noisy warnings#4476NathanFlurry wants to merge 1 commit intomainfrom
NathanFlurry wants to merge 1 commit intomainfrom
Conversation
…s noisy warnings Add proper close reason codes to all WebSocket close calls that were missing them. This ensures complete close reason information flows through the system for debugging and logging. Also suppress the "failed to parse close reason" warning when the reason is empty, since this is a normal case for network disconnects and browser-initiated closes. Changes: - Add close reasons following group.code format to all bare .close() calls - Only warn about malformed close reasons if the reason is non-empty - Update close reason formats to be consistent (pegboard.*, ws.*, sandbox.*) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
🚅 Deployed to the rivet-pr-4476 environment in rivet-frontend
|
PR Review: fix(websocket): add close reasons and suppress noisy warningsOverall this is a clean, focused fix. A few observations: Duplicate branch in
|
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.
Description
This PR fixes WebSocket close handling to provide complete close reason information and reduces noisy logging for normal disconnect scenarios.
When WebSocket connections close, the close reason was either missing entirely or would trigger warnings even on normal disconnects (network drops, browser closes). This fix ensures all closes include proper reason codes for debugging while only warning on actually malformed reasons.
Changes
.close()calls using thegroup.codeformatType of change
How Has This Been Tested?
The changes suppress logging on normal WebSocket disconnects. Close reasons now follow the standard format for proper error tracking and debugging through the logging system.
Checklist