- Notifications
You must be signed in to change notification settings - Fork928
chore: reduce dashboard requests from seeded data#13034
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
We already inject all of this content in `index.html`.There was also a bug with displaying a loading indicator whenthe workspace proxies endpoint 404s.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
site/src/api/queries/users.ts Outdated
queryKey: meKey, | ||
initialData: initialUserData, | ||
queryFn: API.getAuthenticatedUser, | ||
}; | ||
// If we have initial user data, we don't want to fetch | ||
// the user again. We already have it! | ||
if (initialUserData) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think we may could create some util inapi/queries/utils
to reuse the cache configuration across queries:
exportconstcachedQuery={cacheTime:Infinity,staleTime:Infinity,refetchOnMount:false,refetchOnReconnect:false,refetchOnWindowFocus:false,}
So it could be used like this:
constopts:UseQueryOptions<BuildInfoResponse>={ ...cachedQuery,queryKey:buildInfoKey,initialData:initialBuildInfoData,queryFn:()=>API.getBuildInfo(),};
@BrunoQuaresma will do! |
We already inject all of this content in
index.html
.There was also a bug with displaying a loading indicator when the workspace proxies endpoint 404s.