Skip to content

fix(xmpp) Adds logs for shard changed events#2975

Merged
jallamsetty1 merged 1 commit intomasterfrom
add-logs
Feb 5, 2026
Merged

fix(xmpp) Adds logs for shard changed events#2975
jallamsetty1 merged 1 commit intomasterfrom
add-logs

Conversation

@jallamsetty1
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 4, 2026 22:29
Copy link

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 pull request adds logging for shard changed events in the XMPP connection handling code to improve observability and debugging capabilities.

Changes:

  • Added debug and error logging when shard changes are detected
  • Added a warning log when the x-jitsi-shard header is missing in keep-alive responses
  • Modified the shard change detection logic to ignore cases where the shard header is absent rather than treating them as shard changes

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
modules/xmpp/xmpp.ts Adds logging statements for both graceful reconnect and forced reload paths when a shard change is detected
modules/xmpp/XmppConnection.ts Adds defensive null check and warning log for missing shard header, preventing false shard change detection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

JitsiConnectionErrors.SHARD_CHANGED_ERROR
);
} else {
logger.error('Shard changed, kicking the user off the conference and forcing reload', JSON.stringify(details));
Copy link

Copilot AI Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logger from @jitsi/logger accepts objects directly as additional parameters, so JSON.stringify is unnecessary here. This is inconsistent with other logger usage in the codebase. For example, in XmppConnection.ts line 585, logger.error is called with an object parameter directly: logger.error('Websocket Keep alive failed for url: ${url}', { error }). Similarly, in xmpp.ts line 1330, an error object is passed directly: logger.error('Error parsing json ${jsonString}', e). Pass the details object directly as a second parameter instead of stringifying it.

Suggested change
logger.error('Shard changed, kicking the user off the conference and forcing reload', JSON.stringify(details));
logger.error('Shard changed, kicking the user off the conference and forcing reload', details);

Copilot uses AI. Check for mistakes.
@jallamsetty1 jallamsetty1 merged commit e6008c1 into master Feb 5, 2026
8 checks passed
@jallamsetty1 jallamsetty1 deleted the add-logs branch February 5, 2026 16:50
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