Skip to content

Commit

Permalink
Reduce changeset description size, linting, regex to varaible
Browse files Browse the repository at this point in the history
  • Loading branch information
KoryNunn committed Mar 6, 2023
1 parent ebd302f commit 85a82ee
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .changeset/chilled-buckets-sneeze.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
'firebase': patch
---

Check navigator.userAgent, in addition to navigator.appVersion, when determining whether to work around an IndexedDb bug in Safari. Add check for Mobile/# in addition to Version/# to include WKWebView safari versions in this check.
Check navigator.userAgent, in addition to navigator.appVersion, when determining whether to work around an IndexedDb bug in Safari.
7 changes: 6 additions & 1 deletion packages/firestore/src/local/indexeddb_persistence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,12 @@ export class IndexedDbPersistence implements Persistence {
// to make sure it gets a chance to run.
this.markClientZombied();

if (isSafari() && (navigator.appVersion.match(/(?:Version|Mobile)\/1[456]/) || navigator.userAgent.match(/(?:Version|Mobile)\/1[456]/))) {
const safariIndexdbBugVersionRegex = /(?:Version|Mobile)\/1[456]/;
if (
isSafari() &&
(navigator.appVersion.match(safariIndexdbBugVersionRegex) ||
navigator.userAgent.match(safariIndexdbBugVersionRegex))
) {
// On Safari 14, 15, and 16, we do not run any cleanup actions as it might
// trigger a bug that prevents Safari from re-opening IndexedDB during
// the next page load.
Expand Down

0 comments on commit 85a82ee

Please sign in to comment.