Skip to content

v5: solid-query key and data mismatch with staleTime set #5738

@oedotme

Description

@oedotme

Describe the bug

There's data and key mismatch with staleTime configured using Solid Query v5 (only v5, v4 works as expected). In another setup (not the reproduction), the mismatch always happens whether staleTime is set or not.

Your minimal, reproducible example

https://stackblitz.com/edit/solid-query-key-and-data-mismatch

Steps to reproduce

  1. Go to the StackBlitz reproduction
  2. Wait for the dependencies installation and server to start
  3. Initially the select option set to One and the fetching starts for the key ['posts', '1']
  4. Change the select option to Two to fetch for ['posts', '2'] and the data below it will update
  5. Switch to option One with ['posts', '1'], the data will change as expected
  6. Switch back to option Two with ['posts', '2'] but it will keep showing data for key ['posts', '1'] ⚠️

Expected behavior

Switching between the two keys should return the data corresponding to each key.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

  • OS: macOS
  • Browser: Brave (Chromium-based)
  • Version: Brave v1.52.130 Chromium v114.0.5735.198

Tanstack Query adapter

solid-query

TanStack Query version

v5.0.0-alpha.85

TypeScript version

v5.1.3

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