Skip to content

Fix intermittent blank page and profile setup redirect loop#11788

Merged
nbudin merged 2 commits into
mainfrom
fix-initial-load-blank-page
Jun 30, 2026
Merged

Fix intermittent blank page and profile setup redirect loop#11788
nbudin merged 2 commits into
mainfrom
fix-initial-load-blank-page

Conversation

@nbudin

@nbudin nbudin commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Blank page on initial load: RouterProvider (from react-router) initializes its state via useState(router.state). When the root route is lazy, the router starts with initialized=false/renderFallback=true, causing _renderMatches to return null — an empty container. RouterProvider then escapes that null state via startTransition, but something in the concurrent route tree keeps the transition suspended long enough to produce a blank screen lasting 25+ seconds. Fix: gate RouterProvider's mount on router.state.initialized. DataModeApplicationEntry subscribes to the router and shows a spinner until initialization completes, then mounts RouterProvider with an already-initialized state.

  • Redirect loop after new user profile setup: Two bugs conspired to keep users stuck on /my_profile/setup after completing login: (1) UpdateUserConProfile mutation did not return needs_update in its selection set, so Apollo never wrote needs_update: false to the normalized cache after auto-save — every client-side navigation read stale needs_update: true and redirected back; (2) the "Finish" button on the setup form was a plain <Link>, so if the user changed nothing, UpdateUserConProfile was never called at all. Fixed by adding needs_update to the mutation response and changing the Finish button to fetcher.submit with a _redirectTo field so the action runs the mutation and redirects on success.

Test plan

  • Load the app as a logged-out user — no blank screen on initial load
  • Load the app as a returning user — no blank screen on initial load
  • Log in as a new user (no convention profile) — should redirect to /my_profile/setup
  • On /my_profile/setup, click "Finish" without changing anything — should navigate to / without redirecting back
  • On /my_profile/setup, change a field (auto-save fires), then click "Finish" — should navigate to / without redirecting back
  • After completing setup, navigate freely around the convention site — no redirect loops

🤖 Generated with Claude Code

nbudin and others added 2 commits June 30, 2026 11:24
RouterProvider (from react-router) initializes its state via
useState(router.state). When the root route is lazy, the router starts
with initialized=false/renderFallback=true, which causes _renderMatches
to return null — an empty container. RouterProvider then escapes that
null state via startTransition, but something in the concurrent route
tree keeps the transition suspended long enough to produce a blank screen.

Gate RouterProvider's mount on router.state.initialized. DataModeApplicationEntry
subscribes to the router and shows a spinner until initialization completes,
then mounts RouterProvider. By that point router.state has initialized=true,
so useState(router.state) captures the ready state from the start and
RouterProvider renders content immediately without a startTransition escape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two bugs caused users to be stuck on /my_profile/setup:

1. UpdateUserConProfile mutation did not return needs_update in its
   selection set. Apollo never wrote needs_update: false to the normalized
   cache after auto-save, so every subsequent client-side navigation read
   a stale needs_update: true and triggered a redirect. A page refresh
   fixed it by clearing the cache and fetching fresh data, hence the
   "goes away after a page refresh" symptom. Fix: add needs_update to
   the mutation response so Apollo updates the cache on every save.

2. The "Finish" button on the initial setup form was a plain <Link>,
   not a submit. If the user changed nothing, UpdateUserConProfile was
   never called, needs_update stayed true, and every navigation sent
   them back. Fix: change the button to fetcher.submit with _redirectTo
   so the action explicitly runs the mutation (setting needs_update=false)
   and then redirects to / on success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nbudin nbudin added bug patch Bumps the patch version number on release labels Jun 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
Overall Coverage 🟢 54.31% 🟢 54.31% ⚪ 0%

Minimum allowed coverage is 0%, this run produced 54.31%

@nbudin nbudin merged commit ed34283 into main Jun 30, 2026
24 checks passed
@nbudin nbudin deleted the fix-initial-load-blank-page branch June 30, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug patch Bumps the patch version number on release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant