Skip to content
Source
Sign inSign up
TanStack/query

persisted queries are not removed from cache #7691

Send to my agent
Closeddberardo-com(GitHub profile, opens in a new tab) opened this issue 1 comment

Describe the bug

calling queryClient.removeQueries() does not actually do anything in case the queries are persisted in the localStorage using the persister from this guide: https://tanstack.com/query/latest/docs/framework/react/plugins/persistQueryClient

Your minimal, reproducible example

i have none

Steps to reproduce

remove query and reload page ... no changes in the localstorage and old data is loaded

Expected behavior

i am expecting queries to be removed from persisted cache

How often does this bug happen?

None

Screenshots or Videos

No response

Platform

windows chromne

Tanstack Query adapter

None

TanStack Query version

v5

TypeScript version

No response

Additional context

No response

  1. remove query and reload page ... no changes in the localstorage and old data is loaded

    writes are throttled per default to one per second, so if you remove + instantly close / reload the page, there's a chance that the update hasn't been written to localstorage yet. Throttle time is customizable.

    If that's not the issue, please show a minimal reproduction of your problem and I'll re-open this issue.

  2. TkDodo closed this

  3. TkDodo added labelsneeds-info

  4. TkDodo added labelsworks as designed

Sign in to join this conversation.