improve server logging#485
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR improves server logging by adding consistent debug messages throughout the WebSocket message handling flow. It standardizes existing error log messages and adds new log statements to track message processing.
- Added console.log statements to track incoming WebSocket messages and outgoing responses
- Standardized error message prefixes to use "---" format for consistency
- Enhanced visibility into WebSocket message flow for debugging purposes
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| console.error('--- Error creating account inbox:', error); | ||
| return; | ||
| } | ||
| console.log('--- Sent create-account-inbox response'); |
There was a problem hiding this comment.
This log message indicates a response was sent, but there is no actual response being sent to the WebSocket in this case. The function only broadcasts to other clients via broadcastAccountInbox but doesn't send a direct response to the current WebSocket.
| console.error('Error creating update:', err); | ||
| console.error('--- Error creating update:', err); | ||
| } | ||
| console.log('--- Sent create-update response'); |
There was a problem hiding this comment.
This log message indicates a response was sent, but there is no actual response being sent to the WebSocket in this case. The function only broadcasts updates to other clients via broadcastUpdates but doesn't send a direct response to the current WebSocket.
| console.log('--- Sent create-update response'); | |
| // Send error response to client | |
| const errorMessage: Messages.ResponseError = { | |
| type: 'error', | |
| error: err instanceof Error ? err.message : String(err), | |
| requestType: 'create-update', | |
| }; | |
| webSocket.send(Messages.serialize(errorMessage)); | |
| responseSent = true; | |
| } | |
| if (responseSent) { | |
| console.log('--- Sent create-update response'); | |
| } |
No description provided.