From ff38eb072765d6a0453a839de953d64d1f0b921e Mon Sep 17 00:00:00 2001 From: Deepak Bhagat Date: Thu, 12 Mar 2026 04:49:53 +0530 Subject: [PATCH] fix(android): check pending notification before WebSocket connection guard When tapping a push notification while WebSocket is reconnecting, the app opens but does not navigate to the room. This happens because checkPendingNotification() was gated behind isAuthAndConnected(), which requires meteor.connected === true. During reconnection, this check returns false and the notification tap is silently ignored. Fix: Move checkPendingNotification() before the connection guard. This is safe because it dispatches deepLinkingOpen, and the deepLinking saga already waits for LOGIN.SUCCESS before navigating to the room. Fixes #7013 --- app/sagas/state.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/sagas/state.js b/app/sagas/state.js index 358549f2dd7..073f139f8be 100644 --- a/app/sagas/state.js +++ b/app/sagas/state.js @@ -19,6 +19,13 @@ const appHasComeBackToForeground = function* appHasComeBackToForeground() { if (appRoot !== RootEnum.ROOT_INSIDE) { return; } + // Check for pending notification BEFORE connection check. + // This ensures notification taps during WebSocket reconnection are not lost. + // checkPendingNotification() dispatches deepLinkingOpen, and the deepLinking + // saga already waits for LOGIN.SUCCESS before navigating to the room. + checkPendingNotification().catch((e) => { + log('[state.js] Error checking pending notification:', e); + }); const isReady = yield isAuthAndConnected(); if (!isReady) { return; @@ -27,10 +34,6 @@ const appHasComeBackToForeground = function* appHasComeBackToForeground() { const server = yield select(state => state.server.server); yield localAuthenticate(server); checkAndReopen(); - // Check for pending notification when app comes to foreground (Android - notification tap while in background) - checkPendingNotification().catch((e) => { - log('[state.js] Error checking pending notification:', e); - }); return yield setUserPresenceOnline(); } catch (e) { log(e);