Skip to content
Source
Sign inSign up
TanStack/query

[solid-query v5] placeholderData doesn't get replaced if query is previously aborted #5987

Send to my agent
Closedskokenes(GitHub profile, opens in a new tab) opened this issue 2 comments

Describe the bug

I'm trying to implement pagination with placeholderData between pages using solid-query v5 beta 23.

If I rapidly navigate through some pages, causing queries to get aborted, when I go back to those pages, the correct data is never fetched. Rather, the placeholder data is returned.

See this video and codesandbox below

https://github.com/TanStack/query/assets/5554373/27da7aca-8a6d-43bf-a6d8-12ec4960b237

Your minimal, reproducible example

https://codesandbox.io/s/solid-query-placeholder-test-rq734x?file=/index.js

Steps to reproduce

Click the increment page button rapidly several times, then decrement the page and see the wrong results

Expected behavior

Only fetched data should be cached. Placeholder data should be discarded.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

OSX, Chrome

Tanstack Query adapter

None

TanStack Query version

v5 beta 23

TypeScript version

No response

Additional context

No response

  1. I can confirm that this works in react, so it must be a solid specific issue:

    https://codesandbox.io/p/sandbox/sharp-swirles-46xxq3?embed=1&file=/src/index.jsx

    @ardeora FYI

  2. TkDodo added labelsbug

  3. TkDodo added labelspackage: solid-query

  4. TkDodo added labelsv5

  5. NVM, not a bug. There was an error in my code reading an updated signal in the mock API callback. Updated the sandbox above and it works now.

  6. TkDodo removed labelsbug

  7. TkDodo added labelsinvalid

Sign in to join this conversation.