Skip to content

Persist meta in queries #5647

@nahtnam

Description

@nahtnam

Describe the bug

Initially discussed here: https://discord.com/channels/719702312431386674/1121385264569397259

The meta is not persisted which can lead to interesting/unexpected (developer created) bugs

Your minimal, reproducible example

https://codesandbox.io/s/react-typescript-forked-j729lq?file=/src/App.tsx

Steps to reproduce

  1. Go to https://j729lq.csb.app/?query=1. You should get a pop up. Click confirm and refresh the page as many times as you want
  2. Go to https://j729lq.csb.app/?query=2. Same thing, you get a pop up. Click confirm and refresh as much as you want.
  3. Go back to your first tab and refresh the page. Instead of being cached, it now will give you a pop up again.

Expected behavior

Refreshing either tab should not cause the pop up to show up

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: Macos
  • Browser: Chrome
  • Version: 114.0.5735.133

Tanstack Query adapter

react-query

TanStack Query version

4.29.15

TypeScript version

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions