Commit 777aa6e
fix: guard finally clause with promise identity check
When a forceRefresh call bypasses dedup while a prior fetch is still
in-flight, both promises run concurrently. The older promise's finally
would null out balancesFetchInProgress even after the newer force-refresh
promise had replaced it, causing subsequent callers to miss the in-flight
force fetch and spawn redundant RPC calls.
Fix by only clearing the ref when it still points to this promise.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 7651fc5 commit 777aa6e
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
305 | 309 | | |
306 | 310 | | |
307 | 311 | | |
308 | | - | |
| 312 | + | |
| 313 | + | |
309 | 314 | | |
310 | 315 | | |
311 | 316 | | |
| |||
0 commit comments