From 71e726079e10c127b20892ee78cccce440b037c8 Mon Sep 17 00:00:00 2001 From: tamarafinogina Date: Mon, 9 Feb 2026 14:10:56 +0100 Subject: [PATCH 1/5] try relad now --- .../middleware.auto-reconnect.ts | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts index 8f4bd01c70bf..e95aead8bd32 100644 --- a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts +++ b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts @@ -5,7 +5,7 @@ import { hideNotification } from "../../../../notifications/actions"; import { CONFERENCE_WILL_LEAVE } from "../../../conference/actionTypes"; import { isLeavingConferenceManually, setLeaveConferenceManually } from "../../general/utils/conferenceState"; import { CONNECTION_DISCONNECTED, CONNECTION_ESTABLISHED, CONNECTION_FAILED } from "../../../connection/actionTypes"; -import { connect } from "../../../connection/actions.web"; +import { reloadNow } from "../../../../app/actions.web"; import { setJWT } from "../../../jwt/actions"; import MiddlewareRegistry from "../../../redux/MiddlewareRegistry"; import { trackRemoved } from "../../../tracks/actions.any"; @@ -14,13 +14,11 @@ import { hideLoader, showLoader } from "../../loader"; const RECONNECTION_NOTIFICATION_ID = "connection.reconnecting"; const RECONNECTION_LOADER_ID = "auto-reconnect"; const RECONNECTION_WAIT_TIME_MS = 15000; -const MAX_RECONNECTION_ATTEMPTS = 2; const RECONNECTION_DELAY_MS = 3000; const JWT_EXPIRED_ERROR = "connection.passwordRequired"; let reconnectionTimer: number | null = null; let isReconnecting = false; -let reconnectionAttempts = 0; export const isAutoReconnecting = () => isReconnecting; @@ -28,19 +26,16 @@ const hideReconnectionNotification = (store: IStore) => { store.dispatch(hideNotification(RECONNECTION_NOTIFICATION_ID)); }; -const showReconnectionLoader = (store: IStore, attempt: number) => { - const textKey = attempt <= MAX_RECONNECTION_ATTEMPTS ? "loader.reconnecting" : "loader.reloading"; +const showReconnectionLoader = (store: IStore) => { - store.dispatch(showLoader(undefined, textKey, RECONNECTION_LOADER_ID)); + store.dispatch(showLoader(undefined, "loader.reconnecting", RECONNECTION_LOADER_ID)); }; const hideReconnectionLoader = (store: IStore) => { store.dispatch(hideLoader(RECONNECTION_LOADER_ID)); }; -const reloadPage = () => { - window.location.reload(); -}; + const clearExpiredJWT = (store: IStore) => { store.dispatch(setJWT(undefined)); @@ -58,7 +53,7 @@ const clearRemoteTracks = (store: IStore) => { }; const triggerReconnection = (store: IStore) => { - store.dispatch(connect()); + store.dispatch(reloadNow()); }; const scheduleRetry = (store: IStore) => { @@ -69,12 +64,6 @@ const scheduleRetry = (store: IStore) => { }, RECONNECTION_DELAY_MS); }; -const handleMaxAttemptsReached = (store: IStore) => { - isReconnecting = true; - showReconnectionLoader(store, reconnectionAttempts + 1); - reconnectionTimer = window.setTimeout(reloadPage, 2000); -}; - /** * Attempts to reconnect by clearing JWT and connecting to conference again. * If max attempts reached, reloads the page. @@ -82,14 +71,8 @@ const handleMaxAttemptsReached = (store: IStore) => { const attemptReconnection = async (store: IStore) => { if (isLeavingConferenceManually()) return; - if (reconnectionAttempts >= MAX_RECONNECTION_ATTEMPTS) { - handleMaxAttemptsReached(store); - return; - } - - reconnectionAttempts++; isReconnecting = true; - showReconnectionLoader(store, reconnectionAttempts); + showReconnectionLoader(store); try { clearRemoteTracks(store); @@ -112,7 +95,6 @@ const clearTimer = () => { const resetReconnectionState = () => { clearTimer(); - reconnectionAttempts = 0; isReconnecting = false; }; @@ -135,7 +117,6 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => (action: AnyA if (isLeavingConferenceManually()) break; clearTimer(); - reconnectionAttempts = 0; isReconnecting = true; reconnectionTimer = window.setTimeout(() => { From 163566ee63cd3912b88bdcad51e55369b2219e59 Mon Sep 17 00:00:00 2001 From: tamarafinogina Date: Mon, 9 Feb 2026 14:28:02 +0100 Subject: [PATCH 2/5] use connect --- .../connection-stability/middleware.auto-reconnect.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts index e95aead8bd32..30af21d6a87d 100644 --- a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts +++ b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts @@ -5,7 +5,7 @@ import { hideNotification } from "../../../../notifications/actions"; import { CONFERENCE_WILL_LEAVE } from "../../../conference/actionTypes"; import { isLeavingConferenceManually, setLeaveConferenceManually } from "../../general/utils/conferenceState"; import { CONNECTION_DISCONNECTED, CONNECTION_ESTABLISHED, CONNECTION_FAILED } from "../../../connection/actionTypes"; -import { reloadNow } from "../../../../app/actions.web"; +import { connect } from "../../../connection/actions.web"; import { setJWT } from "../../../jwt/actions"; import MiddlewareRegistry from "../../../redux/MiddlewareRegistry"; import { trackRemoved } from "../../../tracks/actions.any"; @@ -53,7 +53,7 @@ const clearRemoteTracks = (store: IStore) => { }; const triggerReconnection = (store: IStore) => { - store.dispatch(reloadNow()); + store.dispatch(connect()); }; const scheduleRetry = (store: IStore) => { From e498f9b6f1c3c53b379771c165cd3f6b240b08df Mon Sep 17 00:00:00 2001 From: tamarafinogina Date: Mon, 9 Feb 2026 17:13:42 +0100 Subject: [PATCH 3/5] add logs --- react/features/app/middleware.ts | 1 + react/features/authentication/middleware.ts | 1 + react/features/base/conference/middleware.any.ts | 1 + react/features/base/connection/reducer.ts | 1 + .../connection-stability/middleware.auto-reconnect.ts | 2 +- react/features/prejoin/middleware.web.ts | 1 + react/features/visitors/middleware.ts | 1 + 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/react/features/app/middleware.ts b/react/features/app/middleware.ts index f2917e4255eb..1ef6d740eac7 100644 --- a/react/features/app/middleware.ts +++ b/react/features/app/middleware.ts @@ -87,6 +87,7 @@ function _connectionEstablished(store: IStore, next: Function, action: AnyAction * @private */ function _connectionFailed({ dispatch, getState }: IStore, next: Function, action: AnyAction) { + console.log("[AUTO_RECONNECT] Entered _connectionFailed to check _isMaybeSplitBrainError"); // In the case of a split-brain error, reload early and prevent further // handling of the action. if (_isMaybeSplitBrainError(getState, action)) { diff --git a/react/features/authentication/middleware.ts b/react/features/authentication/middleware.ts index b4ca7f310609..1b6c76415dc2 100644 --- a/react/features/authentication/middleware.ts +++ b/react/features/authentication/middleware.ts @@ -158,6 +158,7 @@ MiddlewareRegistry.register(store => next => action => { break; case CONNECTION_FAILED: { + console.log("[AUTO_RECONNECT] Entered CONNECTION_FAILED to check jwt"); const { error } = action; const { getState } = store; const state = getState(); diff --git a/react/features/base/conference/middleware.any.ts b/react/features/base/conference/middleware.any.ts index b9df6a6a16ce..e9fca174f238 100644 --- a/react/features/base/conference/middleware.any.ts +++ b/react/features/base/conference/middleware.any.ts @@ -443,6 +443,7 @@ function _logJwtErrors(message: string, errors: string) { * @returns {Object} The value returned by {@code next(action)}. */ function _connectionFailed({ dispatch, getState }: IStore, next: Function, action: AnyAction) { + console.log("[AUTO_RECONNECT] Entered _connectionFailed to maybe send conferenceFailed"); const { connection, error } = action; const { jwt } = getState()['features/base/jwt']; diff --git a/react/features/base/connection/reducer.ts b/react/features/base/connection/reducer.ts index bae27ce9e16e..352f93298b42 100644 --- a/react/features/base/connection/reducer.ts +++ b/react/features/base/connection/reducer.ts @@ -141,6 +141,7 @@ function _connectionFailed( connection: Object; error: ConnectionFailedError; }) { + console.log("[AUTO_RECONNECT] Entered _connectionFailed of reducer"); const connection_ = _getCurrentConnection(state); if (connection_ && connection_ !== connection) { diff --git a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts index 30af21d6a87d..e68b478c2cfb 100644 --- a/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts +++ b/react/features/base/meet/middlewares/connection-stability/middleware.auto-reconnect.ts @@ -140,8 +140,8 @@ MiddlewareRegistry.register((store: IStore) => (next: Function) => (action: AnyA } case CONNECTION_FAILED: { + console.log("[AUTO_RECONNECT] Attempting reconnect"); const { error } = action; - console.log("[AUTO_RECONNECT] Connection failed with error:", error); if (error?.name === JWT_EXPIRED_ERROR && !isLeavingConferenceManually() && !isReconnecting) { attemptReconnection(store); } diff --git a/react/features/prejoin/middleware.web.ts b/react/features/prejoin/middleware.web.ts index 8f7cfb948b60..b7dd4becbf86 100644 --- a/react/features/prejoin/middleware.web.ts +++ b/react/features/prejoin/middleware.web.ts @@ -69,6 +69,7 @@ MiddlewareRegistry.register(store => next => action => { } case CONFERENCE_FAILED: case CONNECTION_FAILED: + console.log("[AUTO_RECONNECT] set setJoiningInProgress to false in middleware"); store.dispatch(setJoiningInProgress(false)); break; case CONFERENCE_JOINED: diff --git a/react/features/visitors/middleware.ts b/react/features/visitors/middleware.ts index 9cf33d04f32f..202172b8ec9c 100644 --- a/react/features/visitors/middleware.ts +++ b/react/features/visitors/middleware.ts @@ -163,6 +163,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => { break; } case CONNECTION_FAILED: { + console.log("[AUTO_RECONNECT] attempting reconnect in CONNECTION_FAILED of visitors middleware"); const { error } = action; if (error?.name !== JitsiConnectionErrors.NOT_LIVE_ERROR) { From 544716ac013ea6438f5a0d62034ab8900daf8173 Mon Sep 17 00:00:00 2001 From: tamarafinogina Date: Mon, 9 Feb 2026 17:37:54 +0100 Subject: [PATCH 4/5] add missing logs --- react/features/base/connection/actions.any.ts | 3 +++ .../connection-notifications/listener-setup.ts | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/react/features/base/connection/actions.any.ts b/react/features/base/connection/actions.any.ts index 9f3c63a68792..4f7dddc874f4 100644 --- a/react/features/base/connection/actions.any.ts +++ b/react/features/base/connection/actions.any.ts @@ -31,6 +31,7 @@ import { JITSI_CONNECTION_URL_KEY } from "./constants"; import logger from "./logger"; import { get8x8Options } from "./options8x8"; import { ConnectionFailedError, IIceServers } from "./types"; +import { log } from '@tensorflow/tfjs-core/dist/log'; /** * The options that will be passed to the JitsiConnection instance. @@ -94,6 +95,7 @@ export function connectionEstablished(connection: Object, timeEstablished: numbe * }} */ export function connectionFailed(connection: Object, error: ConnectionFailedError) { + console.log("[AUTO_RECONNECT] CconnectionFailed return CONNECTION_FAILED action"); const { credentials } = error; if (credentials && !Object.keys(credentials).length) { @@ -311,6 +313,7 @@ export function _connectInternal({ * @returns {void} */ function _onConnectionFailed(err: string, message: string, credentials: any, details: Object) { + console.log("[AUTO_RECONNECT] send CONNECTION_FAILED notification"); // eslint-disable-line max-params unsubscribe(); diff --git a/react/features/base/meet/middlewares/connection-stability/connection-notifications/listener-setup.ts b/react/features/base/meet/middlewares/connection-stability/connection-notifications/listener-setup.ts index e133dcc815aa..8ad1997ea407 100644 --- a/react/features/base/meet/middlewares/connection-stability/connection-notifications/listener-setup.ts +++ b/react/features/base/meet/middlewares/connection-stability/connection-notifications/listener-setup.ts @@ -61,8 +61,10 @@ export const setupXMPPConnectionListeners = (connection: any, dispatch: IStore[" handleXMPPDisconnected(dispatch, message) ); - connection.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED, (error: any, message: string) => - handleXMPPConnectionFailed(dispatch, error, message) + connection.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED, (error: any, message: string) => { + console.log("[AUTO_RECONNECT] dispatched CONNECTION_FAILED from XMPP connection listener"); + handleXMPPConnectionFailed(dispatch, error, message); + } ); state.hasConnectionListeners = true; From b0e376c829afd48624761bffeae36fbe33ea9758 Mon Sep 17 00:00:00 2001 From: tamarafinogina Date: Tue, 10 Feb 2026 09:59:24 +0100 Subject: [PATCH 5/5] switch to lib with web workers clean up --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b629cbdea321..ce7bf80a03ef 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "js-md5": "0.6.1", "js-sha512": "0.8.0", "jwt-decode": "2.2.0", - "lib-jitsi-meet": "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20/lib-jitsi-meet-0.0.20.tgz", + "lib-jitsi-meet": "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20-debug/lib-jitsi-meet-0.0.20-debug.tgz", "lodash-es": "4.17.23", "moment": "2.29.4", "moment-duration-format": "2.2.2", diff --git a/yarn.lock b/yarn.lock index ce266a416176..b3b32f055029 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11081,9 +11081,9 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -"lib-jitsi-meet@https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20/lib-jitsi-meet-0.0.20.tgz": - version "0.0.20" - resolved "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20/lib-jitsi-meet-0.0.20.tgz#5048eba36fa1f6b1884c00d6d5a21e847c9d2c46" +"lib-jitsi-meet@https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20-debug/lib-jitsi-meet-0.0.20-debug.tgz": + version "0.0.20-debug" + resolved "https://github.com/internxt/lib-jitsi-meet/releases/download/v.0.0.20-debug/lib-jitsi-meet-0.0.20-debug.tgz#3e5a6b196a215d2dc449c588c23ad32bded2b1de" dependencies: "@hexagon/base64" "^2.0.4" "@jitsi/js-utils" "^2.6.7"