Skip to content

fix: add gcTime and staleTime to getFetchOptions#75

Open
V1OL3TF0X wants to merge 1 commit into
HuolalaTech:mainfrom
V1OL3TF0X:main
Open

fix: add gcTime and staleTime to getFetchOptions#75
V1OL3TF0X wants to merge 1 commit into
HuolalaTech:mainfrom
V1OL3TF0X:main

Conversation

@V1OL3TF0X
Copy link
Copy Markdown

@V1OL3TF0X V1OL3TF0X commented May 26, 2026

Hi,
Adding this change since I encountered a bug connected to it: if you prefetch with getFetchOptions it would apply the defaults for those two options, which could lead to race cons and possibly no data in cache when it should be there (my use case was that I was prefetching some data that wouldn't change throughout the app's lifecycle (so, staleTime/gcTime = Infinity) and then using getQueryData to get it, noticed some errors about it being undefined)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant