Skip to content

Commit 9ae1884

Browse files
committed
fix(xmpp) Adds logs for shard changed events
1 parent 060c84d commit 9ae1884

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

modules/xmpp/XmppConnection.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,10 @@ export default class XmppConnection extends Listenable {
572572

573573
const responseShard = response.headers.get('x-jitsi-shard');
574574

575-
if (responseShard !== shard) {
575+
!responseShard && logger.warn('No x-jitsi-shard header present in keep-alive response');
576+
577+
// Ignore if no shard header is present.
578+
if (responseShard && responseShard !== shard) {
576579
logger.error(
577580
`Detected that shard changed from ${shard} to ${responseShard}`);
578581
this.eventEmitter.emit(XmppConnection.Events.CONN_SHARD_CHANGED);

modules/xmpp/xmpp.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,13 @@ export default class XMPP extends Listenable {
352352
/* eslint-enable camelcase */
353353

354354
if (this.options.testing?.enableGracefulReconnect) {
355+
logger.debug('Shard changed, attempting graceful reconnect');
355356
this.eventEmitter.emit(
356357
JitsiConnectionEvents.CONNECTION_FAILED,
357358
JitsiConnectionErrors.SHARD_CHANGED_ERROR
358359
);
359360
} else {
361+
logger.error('Shard changed, kicking the user off the conference and forcing reload', JSON.stringify(details));
360362
this.eventEmitter.emit(
361363
JitsiConnectionEvents.CONNECTION_FAILED,
362364
JitsiConnectionErrors.OTHER_ERROR,

0 commit comments

Comments
 (0)