Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

solid-removed-query-not-rebuilt.md

18 lines1012 Bytes

1---
2'@tanstack/solid-query': patch
3---
4​
5fix: stop a mounted observer from re-creating and refetching a removed
6query. The read layer bumps its per-hook version signal on every cache
7event for its hash, `removed` included, and the recompute that followed
8called `queryCache.build()`, which put the entry the caller had just
9deleted straight back. The resurrection was not passive: the rebuilt
10entry also re-pointed the still-live observer, whose mount-fetch policy
11then refetched and repopulated the key, so `removeQueries()` (and
12`clear()`) could not be made to stick while any hook observed the key.
13`query()` now reuses the entry it last read when the cache no longer
14holds that hash, and only builds when the hash is genuinely new, so a
15removal leaves the cache empty and fires no fetch, while the mounted
16reader holds its last value until options change or a real entry returns
17through `setQueryData`, a refetch or a later mount. This is the behavior
18of the other adapters, and of solid-query at 6.0.0-rc.0.