Repository navigation
chore (gql-middleware): Add more logs to clarify the reasons behind WebSocket disconnections from the browser and Hasura - #23347
Conversation
WalkthroughThis set of changes updates log messages across several components of the codebase to provide more explicit context and appropriate log levels. In the Hasura connection reader, log messages for WebSocket closure events now specify "Hasura." In the web server's connection handler, log messages now explicitly mention "browser" connections. The browser WebSocket reader now differentiates between voluntary and other disconnections, logging additional information based on the WebSocket close status. Log levels for reconnection and disconnection events in both the reconnection handler and Redis client have been elevated from debug to info. No changes to exported entities or control flow were made. Sequence Diagram(s)sequenceDiagram
participant Browser
participant WebSrv_Reader
participant Logger
Browser->>WebSrv_Reader: Close WebSocket (with status)
WebSrv_Reader->>WebSrv_Reader: Check error type
alt Context canceled
WebSrv_Reader->>Logger: Debug: Disconnected (context canceled)
else WebSocket close
alt Status: Going Away
WebSrv_Reader->>Logger: Info: Browser closed window (Going Away)
else Other close status
WebSrv_Reader->>Logger: Info: Voluntary browser disconnection (status code)
end
WebSrv_Reader->>Logger: Debug: Disconnected
end
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
|
Thanks! What does this mean? Does it really reconnect for certain events? Why? |
Automated tests Summary✅ All the CI tests have passed! |
Regarding the reconnection logs, our architecture involves the following connection chain: Whenever certain variables change—such as In short: It's normal and expected! |



Add more
INFO-level logs to clarify the reasons behind WebSocket disconnections from the browser and Hasura reconnections.Previously, the logs contained only vague messages such as:
Now, more descriptive logs are added beforehand, for example:
Examples: