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

Incorrect re-fetching of individual wells after leaving WEx unattended🐛 #2529

Open
eliasbruvik opened this issue Aug 23, 2024 · 0 comments
Labels
Bug Something isn't working Javascript Pull requests that update Javascript code

Comments

@eliasbruvik
Copy link
Contributor

eliasbruvik commented Aug 23, 2024

Sometimes when I leave WEx open unattended for a while, the wells shows like this:
image

They will load and show correctly, but it ends up sending a call to the API for every well.

We are using Tanstack Query to cache our data, with a hook for fetching the whole list, and a hook for fetching individual wells (like when refreshing a single well). For some reason it seems like when leaving the page unattended, the data is either invalidated or garbage-collected. We preferably don't want to have to re-fetch the data at all unless manually refreshing the list. gcTime and staleTime is set to infinity for that reason. But if we have to re-fetch, it should at least fetch all the wells at once.

Possibly relevant files:

  • useGetWell.tsx
  • wellItem.tsx
  • useGetWells.tsx
  • router.tsx
  • sidebar.tsx
@eliasbruvik eliasbruvik added Bug Something isn't working Javascript Pull requests that update Javascript code labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Javascript Pull requests that update Javascript code
Projects
None yet
Development

No branches or pull requests

1 participant