-
Notifications
You must be signed in to change notification settings - Fork 900
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
Use userAgent instead of depricated appVersion to check for safari indexDB bug. #6899
Use userAgent instead of depricated appVersion to check for safari indexDB bug. #6899
Conversation
🦋 Changeset detectedLatest commit: 85a82ee 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 |
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
@dconeybe I have done the CLA, is there a way to re-run these jobs? |
I'm not sure. Tagging @cherylEnkidu and @wu-hui, who were working with you on the related bug #6739 |
Please merge in HEAD of the master branch and push it up. The GitHub actions have likely changed quite a bit. |
I did mean #6509 sorry. I'll merge head shortly |
Thanks for updating your PR. Since this dark corner of the Firebase code base is unfamiliar with me, I've reached out to some colleagues for advice. What do you think about leaving the original "if" condition in place, but adding an "or" clause? Basically, check appVersion and userAgent and applying the workaround if at least one of the conditions is true? That would more likely preserve backwards compatibility IMO. |
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.
Please add a changeset using yarn changeset
. It should be a patch release of @firebase/firestore
and firebase
.
For the changeset description, use something like this:
Check
navigator.userAgent
, in addition tonavigator.appVersion
, when determining whether to work around an IndexedDb bug in Safari. Notably, this may be helpful for Cordova apps that lackappVersion
in their webview yet need to apply the workaround.
…, and include regex for WKWebView string
…into fix-safari-indexdb-bug-detection
I've updated this PR to more robustly work in both Safari and in WKWebView (the web view used in native apps). In Safari, the match is Version/{number}, in WKWebView, the match is Mobile/{number}. Also, this bug is present in version 16, so I added that to the check. |
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.
LGTM! Will give approval once GitHub Actions pass. Thanks for your time (and a great deal of patience) in making this contribution to the SDK!
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.
Please merge at your convenience.
"Only those with write access to this repository can merge pull requests." |
Currently firestore persistance is broken in cordova, as WKWebView's appVersion does not match Version/1[45], and appVersion is a depricated feature. This PR swaps to checking the userAgent, which is something cordova apps can affect, allowing some level of mitigation of this issue.
Fixes #6509