Skip to content

improve server logging#485

Merged
nikgraf merged 2 commits into
mainfrom
ng/improve-server-logging
Aug 15, 2025
Merged

improve server logging#485
nikgraf merged 2 commits into
mainfrom
ng/improve-server-logging

Conversation

@nikgraf
Copy link
Copy Markdown
Collaborator

@nikgraf nikgraf commented Aug 15, 2025

No description provided.

Copy link
Copy Markdown
Contributor

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.

Comment thread apps/server/src/index.ts Outdated
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.
Comment thread apps/server/src/index.ts Outdated
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.

2 participants