Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solid-query parallel mutation onSuccess invalidate issue #8140

Open
andraaspar opened this issue Oct 7, 2024 · 1 comment
Open

solid-query parallel mutation onSuccess invalidate issue #8140

andraaspar opened this issue Oct 7, 2024 · 1 comment

Comments

@andraaspar
Copy link

Describe the bug

We have two checkbox components loaded over a slow network. We want to let the user click them at their own pace (not waiting for the response), but then we want to show them correctly once the response comes back.

Yet the old state flashes up until the final response arrives.

See the example.

Your minimal, reproducible example

https://stackblitz.com/edit/solidjs-templates-9nqn4w?file=src%2FAppComp.tsx

Steps to reproduce

  1. Click the two checkboxes within 3 seconds.
  2. Observe the first clicked showing the previous state instead of the new state until the final response arrives.

Expected behavior

The first checkbox to wait in the pending state until the second is resolved, or at least show the correct (new) state.

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

  • OS: Windows 11
  • Browser: Chrome
  • Version: 129.0.6668.90 (Official Build) (64-bit)

Tanstack Query adapter

solid-query

TanStack Query version

5.59.0

TypeScript version

5.1.3

Additional context

No response

@andraaspar
Copy link
Author

Here is the fixed version showing a workaround: https://stackblitz.com/edit/solidjs-templates-qrezwj?file=src%2FAppComp.tsx

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

No branches or pull requests

1 participant