Skip to content

Conversation

nikgraf
Copy link
Collaborator

@nikgraf nikgraf commented Aug 15, 2025

No description provided.

Copy link
Contributor

@Copilot Copilot AI left a 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.

console.error('--- Error creating account inbox:', error);
return;
}
console.log('--- Sent create-account-inbox response');
Copy link

Copilot AI Aug 15, 2025

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.

console.error('Error creating update:', err);
console.error('--- Error creating update:', err);
}
console.log('--- Sent create-update response');
Copy link

Copilot AI Aug 15, 2025

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.

Suggested change
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.

@nikgraf nikgraf merged commit 9ba3aef into main Aug 15, 2025
6 checks passed
@nikgraf nikgraf deleted the ng/improve-server-logging branch August 15, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant