-
Notifications
You must be signed in to change notification settings - Fork 894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove LocalStorage synchronization on storage events in Safari #8408
Conversation
🦋 Changeset detectedLatest commit: 7d069bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
'@firebase/auth': patch | ||
--- | ||
|
||
Remove localStorage synchronization on storage events in Safari iframes. See [GitHub PR #8408](https://github.com/firebase/firebase-js-sdk/pull/8408). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI the changeset tool automatically links to the PR that the changeset was added in when creating the Version Packages PR, but this does make the copy-paste into release notes easier.
This PR removes a localStorage synchronization fix introduced in 2016 to address an issue in Safari 9 (Important: b/28330893). The fix, while necessary at the time, is now causing several Auth tests to fail in Safari. After removing this fix, all tests pass.
The Safari tests are failing because they assume that a storage event without a change to the underlying storage will not trigger callbacks that we attach. With this fix, if we dispatch a storage event without a change to the underlying storage, a manual synchronization will take place, which will then cause the callbacks to be called.
See:
local_storage.test.ts
.Testing:
I tested localStorage behaviour in the latest Safari version with an app hosted at
127.0.0.1
that contains an iframe hosted atlocalhost
. I opened the app in two tabs and triggered localStorage events by signing in with Google in a popup, and observed that changes to localStorage are synchronized correctly across the iframes in both tabs.I created a repro with instructions to help others test this behaviour: https://github.com/dlarocque/safari-iframe-localstorage.