Opus finding
setInterval refresh leaks/double-fires when `refresh` identity changes
- desktop/renderer/src/components/wallet/WalletView.tsx:178-184
The effect depends on `refresh`, whose identity changes whenever any of its closure deps changes (gwStatus, request, store setters). Each re-run clears `intervalRef.current` (the most recent interval) and starts a new one — but only the last assigned interval id is tracked. If for any reason the effect is invoked and the prior interval id isn't yet in intervalRef (e.g., in StrictMode double-invocation in dev or in a race where the cleanup ordering changes), stale intervals can accumulate. Using a ref instead of relying on the captured `id` returned by setInterval is the source of the fragility; a local `const id = setInterval(...); return () => clearInterval(id);` is the correct idiom and avoids any chance of leak.
Recommendation
Replace the ref-based pattern with `const id = setInterval(refresh, 30_000); return () => clearInterval(id);` so the cleanup closes over the exact interval it scheduled.