Fix first-login TypeError on freshly seeded accounts - #836
Merged
Merged
Conversation
✅ Deploy Preview for ucmacm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Summary
When a freshly seeded user logs into the dashboard for the first time, we get this error:
Turns out three different Tanstack queries shared the same query key. Namely in
src/routes/index.tsx:164-185,src/routes/events.tsx:190-215, andsrc/routes/dashboard/index.tsx:99. It all resolves down to["events", "list" ,{}]. It firsts run the index query, which gives{ data: [...], total: n }. And then the dahsboard query does a prefetch, and ends up using the cached content of{ data: [...], total: n }; which is the wrong shape and result. Dashboard query expects[{...}], not{ data: [...], total: n }, thus causing a crash. Reloading works because it force wipes the cache, and the dashboard query result takes over in the cache.We'll also probably removed the old shared queries that inject the staleTime and other options as the routes require Kanae to be up regardless - we can't really "fake" it.
Types of changes
What types of changes does your code introduce to the UC Merced's ACM Chapter Website?
Put an
xin the boxes that applyChecklist
Put an
xin the boxes that apply