-
Notifications
You must be signed in to change notification settings - Fork 3
fix: RTK cache & load interval improvements #196
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
base: master
Are you sure you want to change the base?
Conversation
I know this PR is in draft mode, but it looks good to me! When this PR is ready for review, feel free to request a review from me |
Doesn't the bad news you outlined in your previous comment block this PR? |
Could you respond? I genuinely don't know if this PR is ready to be merged or not now. |
Hi, sorry for getting back to you so late. No, the PR is not blocked, as it now solves a different problem than was initially intended. |
#198 doesn't seem to be fixed for me on this branch. |
Fixes #198.
pollingInterval
to update activities in real-time, as this is useless; The property is used to refetch while component is mounted, but activities unmounts before the first refetch even happens.keepUnusedDataFor: 60 * 60
. This is to keep the cache alive even when no components that need it are currently mounted.setupListeners
call to main.tsx to allow RTK query to respond to events like disconnect/reconnectrefetchOnReconnect: true
to every api to force refetch immediately after getting online again.refetchOnMountOrArgChange
to every api to refetch data on mount afterVITE_LOAD_INTERVAL
seconds have passed, which is how we achieve polling rate.This means that currently, all APIs will only execute a request when:
VITE_LOAD_INTERVAL
seconds have passed since the last fetch.And will return cached data otherwise (if available)