Skip to content

Commit 3e3e604

Browse files
committed
Skip IndexedDB cleanup on Safari 15
This PR changes our IndexedDB shutdown to skip all remaining work items on Safari 15. It is believed that writing to IndexedDB during unload can trigger a bug on Safari that prevents IndexedDB from loading during the next page load.
1 parent e0fe2b6 commit 3e3e604

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/firestore/src/local/indexeddb_persistence.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,10 @@ export class IndexedDbPersistence implements Persistence {
962962
// to make sure it gets a chance to run.
963963
this.markClientZombied();
964964

965-
if (isSafari() && navigator.appVersion.match(`Version/14`)) {
966-
// On Safari 14, we do not run any cleanup actions as it might trigger
967-
// a bug that prevents Safari from re-opening IndexedDB during the
968-
// next page load.
965+
if (isSafari() && navigator.appVersion.match(/Version\/1[45]/)) {
966+
// On Safari 14 and 15, we do not run any cleanup actions as it might
967+
// trigger a bug that prevents Safari from re-opening IndexedDB during
968+
// the next page load.
969969
// See https://bugs.webkit.org/show_bug.cgi?id=226547
970970
this.queue.enterRestrictedMode(/* purgeExistingTasks= */ true);
971971
}

0 commit comments

Comments
 (0)