Repository navigation
Keep the connector page working when Safari blocks sessionStorage - #1995
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Safari throws
SecurityError: The operation is insecureon any access towindow.sessionStoragewhen the browser blocks site storage. The connector detail page read its one-time "secrets moved to variables" notice straight fromwindow.sessionStorageon mount, so for these users the error boundary replaced the whole page (Sentry CLOUD-FRONTEND-12, iPad Safari, release 3cf8738). The new-connector form wrote the same notice right after creating the connector; there the throw would show an error although the connector was created.Both now use
sessionStorefromlib/storage.ts, which never throws and keeps the value in memory when storage is blocked (the notice still shows after the client-side navigation).Behaviour is the same on Cloud and self-hosted: frontend only, no API change.
Changes
connectors/[id]/page.tsx: read and remove the notice throughsessionStore.connectors/new/page.tsx: write the notice throughsessionStore.connector-page-storage-blocked.spec.ts:window.sessionStoragethrows a SecurityError, the page must still render.Type
Testing
In
packages/frontend:npx tsc --noEmit -p tsconfig.json: passed.npx eslinton the three files: 0 errors (2 existingset-state-in-effectwarnings in the new-connector page, not from this change).next dev); relying on the CI Playwright job.Checklist
npm test)Related Issues
Sentry CLOUD-FRONTEND-12.