Skip to content
Source
Sign inSign up
TanStack/query

fix(solid-query): avoid held options reads during cache notifications #12034

Mergedniukanen1(GitHub profile, opens in a new tab)merged 1 commit intosolid-query-v6-pre fromrefs/pull/12034/headmerged by TkDodo View on GitHub

Showing 3 changed files with 104 additions and 4 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/solid-query-transition-cache-events.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/solid-query': patch
+---
+​
+fix: prevent cache notifications during a Solid transition landing from reading a query options memo that has no committed value.
90 additions and 0 deletionspackages/solid-query/src/__tests__/transition-landing.test.tsxAdded
View file
@@ -0,0 +1,90 @@
+import { expect, it } from 'vitest'
+import {
+ createMemo,
+ createRenderEffect,
+ createRoot,
+ createSignal,
+ flush,
+} from 'solid-js'
+import { QueryClient, useQuery } from '..'
+​
+const tick = () => new Promise<void>((resolve) => setTimeout(resolve, 0))
+​
+it('continues transitioning after a query is disposed during landing', async () => {
+ const gates: Array<() => void> = []
+ const shown: Array<number> = []
+ const [step, setStep] = createSignal(0)
+ const client = new QueryClient({
+ defaultOptions: {
+ queries: { retry: false, gcTime: Infinity },
+ },
+ })
+​