Skip to content

fix: guard localStorage access in mobile warning dialog#1428

Merged
joelorzet merged 1 commit into
stagingfrom
fix/mobile-warning-localstorage-safari
Jun 1, 2026
Merged

fix: guard localStorage access in mobile warning dialog#1428
joelorzet merged 1 commit into
stagingfrom
fix/mobile-warning-localstorage-safari

Conversation

@joelorzet
Copy link
Copy Markdown

Summary

MobileWarningDialog reads localStorage in its mount effect without a guard.
iOS Safari in Private Browsing / Lockdown Mode refuses storage access and throws
SecurityError: The operation is insecure. (DOMException code 18). Because the
component mounts globally via the root layout, an unguarded throw here surfaces
as a handled error on every page for those users.

Change

Wrap both the read (mount effect) and write (dismiss handler) in try/catch and
fail open: if storage is unavailable, show the warning and let dismiss work for
the session. No new abstraction; matches the inline try/catch pattern already
used in app-banner.tsx and pending-template-runner.tsx.

Note: landing as hardening, not asserting it closes the production iOS Safari
SecurityError, since the minified stack can't be mapped to an exact frame
without source maps. Leaving that issue open to verify against recurrence.

iOS Safari in Private Browsing / Lockdown Mode throws
SecurityError when localStorage is accessed. The mount effect read
storage unguarded, surfacing an unhandled error on every page for
those users. Wrap both reads and writes in try/catch and fail open.
@joelorzet joelorzet requested review from a team, OleksandrUA, eskp and suisuss and removed request for a team June 1, 2026 15:15
@joelorzet joelorzet merged commit 1fc75eb into staging Jun 1, 2026
32 checks passed
@joelorzet joelorzet deleted the fix/mobile-warning-localstorage-safari branch June 1, 2026 15:16
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

🧹 PR Environment Cleaned Up

The PR environment has been successfully deleted.

Deleted Resources:

  • Namespace: pr-1428
  • All Helm releases (Keeperhub, Scheduler, Event services)
  • PostgreSQL Database (including data)
  • LocalStack, Redis
  • All associated secrets and configs

All resources have been cleaned up and will no longer incur costs.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

ℹ️ No PR Environment to Clean Up

No PR environment was found for this PR. This is expected if:

  • The PR never had the deploy-pr-environment label
  • The environment was already cleaned up
  • The deployment never completed successfully

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