Skip to content

Commit ff38eb0

Browse files
committed
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
1 parent 48c5fc2 commit ff38eb0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

app/sagas/state.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ const appHasComeBackToForeground = function* appHasComeBackToForeground() {
1919
if (appRoot !== RootEnum.ROOT_INSIDE) {
2020
return;
2121
}
22+
// Check for pending notification BEFORE connection check.
23+
// This ensures notification taps during WebSocket reconnection are not lost.
24+
// checkPendingNotification() dispatches deepLinkingOpen, and the deepLinking
25+
// saga already waits for LOGIN.SUCCESS before navigating to the room.
26+
checkPendingNotification().catch((e) => {
27+
log('[state.js] Error checking pending notification:', e);
28+
});
2229
const isReady = yield isAuthAndConnected();
2330
if (!isReady) {
2431
return;
@@ -27,10 +34,6 @@ const appHasComeBackToForeground = function* appHasComeBackToForeground() {
2734
const server = yield select(state => state.server.server);
2835
yield localAuthenticate(server);
2936
checkAndReopen();
30-
// Check for pending notification when app comes to foreground (Android - notification tap while in background)
31-
checkPendingNotification().catch((e) => {
32-
log('[state.js] Error checking pending notification:', e);
33-
});
3437
return yield setUserPresenceOnline();
3538
} catch (e) {
3639
log(e);

0 commit comments

Comments
 (0)