Skip to content

fix(login): Resolve dashboard connection delay with robust loading state - #246

Merged
ChitkulLakshya merged 4 commits into
mainfrom
fix/login-dashboard-delay
Jul 22, 2026
Merged

fix(login): Resolve dashboard connection delay with robust loading state#246
ChitkulLakshya merged 4 commits into
mainfrom
fix/login-dashboard-delay

Conversation

@ChitkulLakshya

Copy link
Copy Markdown
Member

Root Cause Analysis

Users have frequently experienced a 1 to 2 minute UI 'freeze' when clicking the Continue to Dashboard button on the Login page if an active session is detected. This happens because the backend API (/api/users/me) can experience Serverless cold starts or network latency, taking up to 2 minutes to respond on free tiers. The frontend \handleContinue\ function lacked any visual feedback during this asynchronous wait, leading to a degraded UX where the app appeared unresponsive.

Proposed Changes

This PR systematically addresses the lack of UI feedback by breaking down the solution into three distinct commits:

  1. Refactored \handleContinue: Wrapped the asynchronous \postLoginRedirect\ call in a \ ry-finally\ block, injecting a \loading\ state boolean that toggles seamlessly during the network request.
  2. Disabled Button State: Bound the \loading\ state directly to the Continue to Dashboard and Switch Account buttons. This crucially prevents duplicate submissions and prevents the user from clicking away while the backend spins up.
  3. Visual Spinner Implementation: Substituted the static \ArrowRight\ icon with an animated \RefreshCw\ spinner when the loading state is true, simultaneously updating the button text to 'Connecting...' to provide immediate, actionable feedback to the user.

Verification

  • Clicked 'Continue to Dashboard'.
  • Button immediately disabled.
  • Spinner activated with 'Connecting...'.
  • UI remained in loading state until the backend returned the payload, then properly routed to /dashboard.

Note: The underlying cold-start issue itself is being mitigated at the infrastructure level via UptimeRobot pings to the backend API base URL.

Copilot AI review requested due to automatic review settings July 22, 2026 09:34
@vercel

vercel Bot commented Jul 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
zync Ready Ready Preview, Comment Jul 22, 2026 9:48am

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ChitkulLakshya
ChitkulLakshya merged commit 5f7f011 into main Jul 22, 2026
7 checks passed
@ChitkulLakshya
ChitkulLakshya deleted the fix/login-dashboard-delay branch July 22, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants