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.
This commit is contained in:
orca-bug-scan-bot
2026-07-14 12:33:23 -07:00
parent 8e0977d295
commit 041e787947
+9 -4
View File
@@ -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