Skip to content

Add loader to profile page, fix terminal brightBlack - #1674

Merged
david-crespo merged 2 commits into
mainfrom
real-profile-fix
Jul 18, 2023
Merged

david-crespo merged 2 commits into
mainfrom
real-profile-fix

Conversation

@david-crespo

@david-crespo david-crespo commented Jul 18, 2023 •

Copy link
Copy Markdown
Collaborator

Closes #1666
Closes #1667

The profile page didn't have a loader! This was masked by the fact that we fetch the current user and their groups for all pages. So we usually had the data on hand.

/** Loader for the `<Route>` that wraps all authenticated routes. */
export const userLoader = async () => {
await Promise.all([
apiQueryClient.prefetchQuery('currentUserView', {}),
apiQueryClient.prefetchQuery('currentUserGroups', {}),

However, the default cacheTime in React Query v4 is 5 minutes (see docs) and after that, the data is not stale — it's totally gone from memory. So if you load the console and wait 5 minutes before navigating, we would fail when we hit the page because the data that was supposed to be fetched in the loader has disappeared. I was able to confirm this is the explanation by setting cacheTime to 10 seconds instead of 5 minutes and commenting out the loader for groups. This produces the failure after 10 seconds, but not before.

I also threw in the brightBlack change, why not.

@vercel

vercel Bot commented Jul 18, 2023

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview Jul 18, 2023 4:01pm

This branch was successfully deployed

1 active deployment
Preview — 68ee7f5d Deployed Jul 18, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invariant failed error after browser timed out A better dark-mode xterm.js color theme?

1 participant