Skip to content
Source
Sign inSign up
TanStack/query

fix(query-core): do not schedule garbage collection on the server #12026

ClosedAdzerKI(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/12026/headopened View on GitHub

Showing 3 changed files with 30 additions and 1 deletion.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/quiet-timers-rest.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/query-core': patch
+---
+​
+Do not schedule garbage collection on the server, even with an explicit `gcTime`
20 additions and 0 deletionspackages/query-core/src/__tests__/query.test.tsxModified
View file
@@ -13,6 +13,7 @@
dehydrate,
hydrate,
noop,
+ timeoutManager,
} from '..'
import { hashQueryKeyByOptions } from '../utils'
import { mockOnlineManagerIsOnline, setIsServer } from './utils'
@@ -1005,6 +1006,25 @@
+ it('should not schedule garbage collection on the server, even with an explicit gcTime', () => {
+ const resetIsServer = setIsServer(true)
+ const scheduled = vi.spyOn(timeoutManager, 'setTimeout')