Skip to content

Keep navbar auth links available when the auth chunk fails - #1557

Merged
manudeli merged 1 commit into
mainfrom
manudeli/fix-navbar-auth-chunk-fallback
Nov 22, 2026
Merged

manudeli merged 1 commit into
mainfrom
manudeli/fix-navbar-auth-chunk-fallback

Conversation

@manudeli

@manudeli manudeli commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Isolate desktop and mobile navbar auth controls with the existing CatchBoundary pattern so a failed auth chunk leaves the page usable.
  • Show a login link for signed-out visitors and an account link for signed-in visitors. The fallback links request a fresh document.
  • Retain stale-app reload and Sentry reporting when recovery does not start.

Verification

  • Injected a chunk-load error into the desktop and mobile boundaries and checked all four auth-state combinations, fallback destinations, and reload/report handling.
  • Both targeted Sentry tests and formatting passed.
  • Direct local unit run passed 729 tests and skipped six. Three tests were blocked by local listener or headless Chrome startup.

Summary by CodeRabbit

  • Bug Fixes
    • Improved recovery when authentication controls encounter an error: available account or sign-in links remain accessible, and navigating through them refreshes the page when needed.
    • Authentication errors that cannot be resolved through a refresh are handled without disrupting the rest of the navigation bar.
    • Loading states and existing-user states continue to display their fallback indicators.

@changeset-bot

changeset-bot Bot commented Nov 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1de0ae5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Navbar desktop and mobile auth controls now use error boundaries. When auth controls fail, the fallback link reflects the user state and reloads the document on navigation. The error handler attempts stale-app recovery before sending unrecovered errors to Sentry.

Changes: Navbar authentication controls

Layer / File(s) Summary
Shared auth error handling and fallback selection
src/components/Navbar.tsx
The shared error handler attempts stale-app recovery before capturing unrecovered errors in Sentry. The fallback link helper selects the label and icon from the user state and supports document reload.
Desktop and mobile auth boundaries
src/components/Navbar.tsx
Desktop and mobile auth controls use error boundaries that render the state-dependent fallback link on failure. Existing loading fallbacks remain. The mobile fallback preserves its tab order and navigation handler.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: tannerlinsley, bart-krakowski, abeuty

Merge Risk: Minimal · up to 1de0a

The navbar auth controls now fall back to a login or account link if the auth chunk fails to load, so the page stays usable. No actionable merge risk remains in the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: navbar auth links stay available when the auth chunk fails. The raw summary confirms desktop and mobile auth controls are wrapped in CatchBoundary with a fallback lin…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title states the main change: navbar auth links stay available when the auth chunk fails. The raw summary confirms desktop and mobile auth controls are wrapped in CatchBoundary with a fallback link that shows Account or Log In/Sign In and reloads the document. The objectives describe the same goal. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 39ef6bdf-a7d0-4ef3-9f6b-4174914ece3f
Commits

Reviewing files that changed from the base of the PR and between bff92ae and 1de0ae5.

Files selected for processing: 1

  • src/components/Navbar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown
Asset Main PR merge build Change
JavaScript 19580.37 KiB 19580.19 KiB 🟢 -0.18 KiB (-0.00%)
JavaScript (gzip) 6443.73 KiB 6443.52 KiB 🟢 -0.21 KiB (-0.00%)
CSS 831.83 KiB 831.83 KiB 0.00 KiB (0.00%)
CSS (gzip) 127.01 KiB 127.01 KiB 0.00 KiB (0.00%)
Page Main (gzip) PR merge build (gzip) Change
/ 593.17 KiB 596.10 KiB 🔴 +2.93 KiB (+0.49%)
/libraries 535.85 KiB 538.79 KiB 🔴 +2.94 KiB (+0.55%)
/start/latest 560.64 KiB 563.58 KiB 🔴 +2.94 KiB (+0.52%)
/router/latest 560.94 KiB 563.88 KiB 🔴 +2.94 KiB (+0.52%)
/query/latest 559.39 KiB 562.32 KiB 🔴 +2.93 KiB (+0.52%)
/table/latest 592.20 KiB 595.14 KiB 🔴 +2.94 KiB (+0.50%)
/charts/latest 641.50 KiB 644.43 KiB 🔴 +2.93 KiB (+0.46%)
/ai/latest 586.31 KiB 589.25 KiB 🔴 +2.94 KiB (+0.50%)
Docs article 546.91 KiB 549.85 KiB 🔴 +2.94 KiB (+0.54%)
Framework docs article 546.92 KiB 549.85 KiB 🔴 +2.94 KiB (+0.54%)
/blog 540.06 KiB 542.99 KiB 🔴 +2.93 KiB (+0.54%)
/maintainers 539.14 KiB 542.08 KiB 🔴 +2.94 KiB (+0.54%)
/showcase 537.11 KiB 540.04 KiB 🔴 +2.93 KiB (+0.55%)
/chat 535.59 KiB 538.52 KiB 🔴 +2.93 KiB (+0.55%)
/chat/c/:conversationId 536.30 KiB 539.22 KiB 🔴 +2.92 KiB (+0.54%)

Page sizes sum the JS and CSS in the TanStack Start manifest for each route and its layouts. Shared files count once per page.

Compared with main at bff92ae. Gzip sizes are summed per file. Build run

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 1de0ae5 Commit Preview URL

Branch Preview URL
Nov 22 2026, 05:06 PM

@manudeli
manudeli merged commit 8c1e50a into main Nov 22, 2026
11 checks passed
@manudeli
manudeli deleted the manudeli/fix-navbar-auth-chunk-fallback branch November 22, 2026 17:16
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