-
Notifications
You must be signed in to change notification settings - Fork 8
improve server logging #485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
apps/server/src/index.ts
Outdated
console.error('--- Error creating account inbox:', error); | ||
return; | ||
} | ||
console.log('--- Sent create-account-inbox response'); |
Copilot
AI
Aug 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Copilot uses AI. Check for mistakes.
apps/server/src/index.ts
Outdated
console.error('Error creating update:', err); | ||
console.error('--- Error creating update:', err); | ||
} | ||
console.log('--- Sent create-update response'); |
Copilot
AI
Aug 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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'); | |
} |
Copilot uses AI. Check for mistakes.
No description provided.