Opus finding
Sidebar refresh's setLoading(false) runs unconditionally on stale request when gwStatus disconnects mid-flight
lowconcurrencymedium
- desktop/renderer/src/components/wallet/WalletSidebarPanel.tsx:32-60
If the user clicks refresh, then quickly the gateway disconnects and reconnects, two `refresh` calls can overlap. There is no cancellation token; both will eventually call `setLoading(false)` and `setBalances`, with the later-returning (possibly stale) request overwriting fresher data. Same pattern in WalletView. This is a typical async race in store-backed UI components.
Recommendation
Track an in-flight token (or AbortController) and ignore results from any but the latest refresh call.