From 041e78794745c72ed4fef20c8ee33bc5e196caa4 Mon Sep 17 00:00:00 2001 From: orca-bug-scan-bot Date: Tue, 14 Jul 2026 12:33:23 -0700 Subject: [PATCH] fix: address pr-bug-scan validated finding from #8690 In index.tsx wireUp, stop tearing down the notification subscription on non-'connected' states so its stream survives reconnect and reconnectReadyCount can exceed 1, firing fetchMissed. --- mobile/app/index.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mobile/app/index.tsx b/mobile/app/index.tsx index d92dffb0a3e..0aae4856c17 100644 --- a/mobile/app/index.tsx +++ b/mobile/app/index.tsx @@ -528,10 +528,15 @@ export default function HomeScreen() { fetchTaskProviders(entry.client, entry.hostId, setTaskProvidersByHost, () => false) } } else { - if (unsubNotif) { - unsubNotif() - unsubNotif = null - } + // Why (#8129): keep the notification subscription alive across the + // reconnect cycle. subscribeToDesktopNotifications relies on the RPC + // client replaying its stream and re-emitting `ready` on reconnect to + // trigger catch-up (fetchMissed, gated on reconnectReadyCount > 1). + // Tearing it down on every non-'connected' state destroyed and + // recreated the subscription each reconnect, resetting the internal + // reconnectReadyCount to 0 so catch-up never fired. The subscription + // is still disposed by the effect cleanup below when the + // (hostId, client) pair changes. if (unsubAccounts) { unsubAccounts() unsubAccounts = null