Skip to content

Fix dashboard crash when localStorage is unavailable#10

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-5b90
Draft

Fix dashboard crash when localStorage is unavailable#10
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-investigation-5b90

Conversation

@cursor

@cursor cursor Bot commented Jun 7, 2026

Copy link
Copy Markdown

Bug and impact

Browsers that throw on localStorage access (for example restricted/private profiles, blocked site storage, or quota/security failures) could successfully fetch and render a snapshot, then throw during post-render persistence. The outer loadSnapshot catch treated that persistence failure as a load failure, called showError(), and cleared the populated qualified table, leaving the dashboard unusable despite valid data.

Root cause

docs/dashboard/app.js mixed critical render/load logic with direct localStorage.getItem/setItem/removeItem calls. Several of those calls run during startup and after render(data), so a storage exception could abort the page or unwind into the snapshot load error handler.

Fix

Added small safe localStorage helpers and routed dashboard storage reads/writes/removals through them. Storage-backed preferences and notification baselines now degrade gracefully while valid snapshot rendering remains intact.

Validation

  • node --check docs/dashboard/app.js
  • CDP browser test against the real dashboard with a pre-load shim that makes window.localStorage throw SecurityError: rendered 41 table rows, empty error banner, populated snapshot metadata.
  • Manual GUI walkthrough against http://127.0.0.1:8765/dashboard/?api=../qualified_public_snapshot.json confirmed populated table rows and no visible error banner; saved video artifact dashboard_storage_fix_manual_walkthrough.mp4.
Open in Web View Automation 

Co-authored-by: Edward Thompson <edwardlthompson@users.noreply.github.com>
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