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

🪲Bug: Fix Caching issues with TanStack Query #31

Closed
vogelino opened this issue Jan 20, 2025 · 2 comments
Closed

🪲Bug: Fix Caching issues with TanStack Query #31

vogelino opened this issue Jan 20, 2025 · 2 comments
Assignees

Comments

@vogelino
Copy link
Owner

Measurements: Switching between different climate parameter when “Zeitspanne” active is not working. When switching climate parameters, the graphic does not update.

This is due to an issue with TanStack Query. The first fetch with a query key that is used for the first time is working properly, however subsequent fetches do not update the data.

@vogelino vogelino moved this to Todo in Release Jan 20, 2025
@vogelino vogelino added this to Release Jan 20, 2025
@vogelino vogelino moved this from Todo to In Progress in Release Jan 20, 2025
@vogelino vogelino moved this from In Progress to Review / Waiting in Release Jan 20, 2025
@vogelino
Copy link
Owner Author

@alsino I finally found the way to fix the charts not updating 🎉

The reasons were manifold.

1️⃣ First, there was an issue with TanStack query not recognizing changes in dynamic variables made with svelte 5 runes. This can be fixed thanks to the utility function reactiveQueryArgs as found on this thread: TanStack/query#7497

2️⃣ Then, there is an issue in the unovis library that prevents charts to update if passed a data object it already has seen before (a weirdo this one). The short term solution for this is to wrap the unovis chart into a {#key data} block. This is a shorterm solution, as it has the drawback to rerender the full chart instead of animating between states. This is due to unovis not yet having being rewritten in svelte 5. See this thread for more details: f5/unovis#500

I hope we won't have anymore surprises now. If you notice anything weird let me know please. Cheers!

@vogelino vogelino self-assigned this Jan 20, 2025
@alsino
Copy link
Collaborator

alsino commented Jan 21, 2025

Wow, what a relieve!!! 🎉🥳 Thanks a lot for your effort in hunting these issues down!! I hope it will be all downhill from here :)

Of course the unovis bug is a bit annoying, but for now this is ok. Let's hope this will be fixed until the ennd of the project.

@vogelino vogelino moved this from Review / Waiting to Done in Release Jan 21, 2025
@vogelino vogelino closed this as completed by moving to Done in Release Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants