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

chore: reduce dashboard requests from seeded data #13034

Merged
merged 9 commits into from
Apr 22, 2024
Merged

Conversation

kylecarbs
Copy link
Member

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.

@kylecarbs kylecarbs self-assigned this Apr 22, 2024
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.
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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a 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 in api/queries/utils to reuse the cache configuration across queries:

export const cachedQuery = {
   cacheTime: Infinity,
   staleTime: Infinity,
   refetchOnMount: false,
   refetchOnReconnect: false,
   refetchOnWindowFocus: false,
}

So it could be used like this:

const opts: UseQueryOptions<BuildInfoResponse> = {
   ...cachedQuery,
   queryKey: buildInfoKey,
   initialData: initialBuildInfoData,
   queryFn: () => API.getBuildInfo(),
 };

@kylecarbs
Copy link
Member Author

@BrunoQuaresma will do!

@kylecarbs kylecarbs changed the title chore: reduce requests the dashboard makes from seeded data chore: reduce dashboard requests from seeded data Apr 22, 2024
@kylecarbs kylecarbs merged commit d3f3ace into main Apr 22, 2024
24 of 26 checks passed
@kylecarbs kylecarbs deleted the redundantreqs branch April 22, 2024 20:07
@github-actions github-actions bot locked and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants