Mobile browser white screen after login on hesychia.ai #54

Closed
opened 2026-07-29 02:41:46 -07:00 by westfarn · 2 comments
Owner

Problem

On mobile browsers, logging into hesychia.ai shows the UI briefly, then the screen goes white. Pull-to-refresh flashes the UI for a split second before blanking again.

Likely cause

Auth bootstrap reads JWT tokens from localStorage at startup. Some mobile browsers (private mode, blocked storage) expose localStorage but throw SecurityError on access. That uncaught exception crashes React during boot.

Expected behavior

App should render normally (or fall back to unauthenticated sign-in) when storage is unavailable, instead of crashing to a white screen.

Reproduction

  1. Open hesychia.ai on a mobile browser (especially private/incognito).
  2. Sign in.
  3. Observe white screen after initial render flash.

Proposed fix

Wrap all localStorage access in tokenStorage.js with a safe helper that catches storage errors and treats tokens as unavailable.

## Problem On mobile browsers, logging into hesychia.ai shows the UI briefly, then the screen goes white. Pull-to-refresh flashes the UI for a split second before blanking again. ## Likely cause Auth bootstrap reads JWT tokens from `localStorage` at startup. Some mobile browsers (private mode, blocked storage) expose `localStorage` but throw `SecurityError` on access. That uncaught exception crashes React during boot. ## Expected behavior App should render normally (or fall back to unauthenticated sign-in) when storage is unavailable, instead of crashing to a white screen. ## Reproduction 1. Open hesychia.ai on a mobile browser (especially private/incognito). 2. Sign in. 3. Observe white screen after initial render flash. ## Proposed fix Wrap all `localStorage` access in `tokenStorage.js` with a safe helper that catches storage errors and treats tokens as unavailable.
Author
Owner

Follow-up from mobile screen recording

Recording (Vivaldi Android, logged in, after #55 deploy) still shows solid white page at hesychia.ai. Pull-to-refresh spinner appears; no durable UI.

localStorage guard did not fix this — looking for remount / render crash causes next (notably Outlet key={Date.now()} in App.tsx).

## Follow-up from mobile screen recording Recording (Vivaldi Android, logged in, after #55 deploy) still shows solid white page at `hesychia.ai`. Pull-to-refresh spinner appears; no durable UI. localStorage guard did not fix this — looking for remount / render crash causes next (notably `Outlet key={Date.now()}` in `App.tsx`).
Author
Owner

Root cause update (from production + recording)

Recording still solid white at hesychia.ai after login (pull-to-refresh only).

#55 localStorage guard was necessary hygiene but not the crash.

Found in live prod bundle:

loading ? <div>Loading</div>
  : authenticated ? <Outlet key={Date.now()} />
  : <Navigate to="/signin/" />

key={Date.now()} remounts dashboard on every parent re-render (WS/account/message updates) → flash then white on mobile.

Follow-up PR removes that key + memoizes theme.

## Root cause update (from production + recording) Recording still solid white at `hesychia.ai` after login (pull-to-refresh only). `#55` localStorage guard was necessary hygiene but **not** the crash. Found in **live** prod bundle: ```js loading ? <div>Loading</div> : authenticated ? <Outlet key={Date.now()} /> : <Navigate to="/signin/" /> ``` `key={Date.now()}` remounts dashboard on every parent re-render (WS/account/message updates) → flash then white on mobile. Follow-up PR removes that key + memoizes theme.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ai_ml_operations/chat_web_app#54