Skip to content

Commit 85a82ee

Browse files
committed
Reduce changeset description size, linting, regex to varaible
1 parent ebd302f commit 85a82ee

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/chilled-buckets-sneeze.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
'firebase': patch
44
---
55

6-
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.
6+
Check navigator.userAgent, in addition to navigator.appVersion, when determining whether to work around an IndexedDb bug in Safari.

packages/firestore/src/local/indexeddb_persistence.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,12 @@ export class IndexedDbPersistence implements Persistence {
977977
// to make sure it gets a chance to run.
978978
this.markClientZombied();
979979

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

0 commit comments

Comments
 (0)