Commit 2bfb12c
fix(query-core): clear timers when timer ID is 0 (TanStack#10401)
* fix(query-core): use explicit undefined check for timer IDs
Custom TimeoutProvider implementations may return 0 as a valid timer
ID (e.g. a counter-based provider), but the existing truthy checks
treated 0 as "no timer" and skipped clearTimeout/clearInterval. This
left stale timers running, causing unexpected refetches and GC leaks.
Compare against undefined instead, matching the optional `?:
ManagedTimerId` field types.
Fixes TanStack#10395
* chore: add changeset for TanStack#10395
---------
Co-authored-by: Dominik Dorfmeister 🔮 <office@dorfmeister.cc>1 parent 48c3975 commit 2bfb12c
3 files changed
Lines changed: 8 additions & 3 deletions
File tree
- .changeset
- packages/query-core/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
| 427 | + | |
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
0 commit comments