Skip to content

fix(web): Update lists reactively by replacing them in setQueryData() #6509

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

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

jkeiser
Copy link
Contributor

@jkeiser jkeiser commented Jun 26, 2025

This fixes the "stalling problem" where component list stops showing new components after some time, and never recovers.

How does this PR change the system?

This PR fixes a reactivity problem with our use of tanstack's setQueryData(). If a list has its cache busted (and gets requeried), tanstack no longer provides a reactive list at the top level (though each element appears reactive). So after this happens, our code that pushes new components into the list no longer triggers the UI to re-render. I'm not sure why tanstack does this, but they warn about this pattern here:

It might work at first but can lead to subtle bugs along the way.

Out of Scope:

  • Removing the cache bust: We do not believe we should be busting the cache in the first place, as it's unperformant and unnecessary; but with this fix, we at least react correctly. Doing it at this level blocks the problem from all our list MVs that use the updateCache() pattern. We'll fix the performance issue another time.

How was it tested?

  • Ran a script to create 250 components, load the workspace in 3 tabs, and obsessively reload them one by one. No stalls and everything shows correctly.
  • Added an artifical cache bust locally to reliably repro the problem. It stopped reproing after this fix was applied.

In short: 🔗

@jkeiser jkeiser requested review from jobelenus and britmyerss June 26, 2025 00:50
@github-actions github-actions bot added the A-web label Jun 26, 2025
Copy link

github-actions bot commented Jun 26, 2025

Dependency Review

✅ No vulnerabilities or OpenSSF Scorecard issues found.

Scanned Files

None

jobelenus
jobelenus previously approved these changes Jun 26, 2025
@stack72 stack72 force-pushed the jkeiser/no-more-stalling branch from a77bb7d to 87e70c8 Compare June 26, 2025 11:05
@stack72 stack72 enabled auto-merge June 26, 2025 11:07
@stack72 stack72 added this pull request to the merge queue Jun 26, 2025
Merged via the queue into main with commit f8a2e7b Jun 26, 2025
10 checks passed
@stack72 stack72 deleted the jkeiser/no-more-stalling branch June 26, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy