Skip to content

Fix first-login TypeError on freshly seeded accounts - #836

Merged
No767 merged 1 commit into
react-rewritefrom
fix-one-issue
Aug 1, 2026
Merged

No767 merged 1 commit into
react-rewritefrom
fix-one-issue

Conversation

@No767

@No767 No767 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

When a freshly seeded user logs into the dashboard for the first time, we get this error:

TypeError: (events ?? []).map is not a function
    at DashboardHome (index.tsx:192:53)
    at Object.react_stack_bottom_frame (react-dom_client.js?v=051dd9c8:12864:12)
    at renderWithHooks (react-dom_client.js?v=051dd9c8:4211:19)
    at updateFunctionComponent (react-dom_client.js?v=051dd9c8:5567:16)
    at beginWork (react-dom_client.js?v=051dd9c8:6138:20)
    at runWithFiberInDEV (react-dom_client.js?v=051dd9c8:850:66)
    at performUnitOfWork (react-dom_client.js?v=051dd9c8:8427:92)
    at workLoopSync (react-dom_client.js?v=051dd9c8:8323:37)
    at renderRootSync (react-dom_client.js?v=051dd9c8:8307:6)
    at performWorkOnRoot (react-dom_client.js?v=051dd9c8:7992:27)

The above error occurred in the <DashboardHome> component.

React will try to recreate this component tree from scratch using the error boundary you provided, CatchBoundaryImpl.

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, and src/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 x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (Updates to README.md, the documentation, etc)
  • Other (if none of the other choices apply)

Checklist

Put an x in the boxes that apply

  • If code changes were made then they have been tested.
  • All workflows pass with my new changes
  • This PR does not address a duplicate issue or PR

@netlify

netlify Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ucmacm ready!

Name Link
🔨 Latest commit 23f3294
🔍 Latest deploy log https://app.netlify.com/projects/ucmacm/deploys/6a6e5b87a75e6800080db640
😎 Deploy Preview https://deploy-preview-836--ucmacm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 84
Accessibility: 97
Best Practices: 92
SEO: 83
PWA: 100
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

sonarqubecloud Bot commented Aug 1, 2026

Copy link
Copy Markdown

@No767
No767 merged commit a9111fa into react-rewrite Aug 1, 2026
10 checks passed
@No767
No767 deleted the fix-one-issue branch August 1, 2026 20:49
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.

1 participant