File tree 1 file changed +11
-0
lines changed
packages/firestore/src/local
1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ import { PersistencePromise } from './persistence_promise';
22
22
import { SCHEMA_VERSION } from './indexeddb_schema' ;
23
23
import { Deferred } from '../util/promise' ;
24
24
import { PersistenceTransaction } from './persistence' ;
25
+ import { Code , FirestoreError } from '../util/error' ;
25
26
26
27
const LOG_TAG = 'SimpleDb' ;
27
28
@@ -62,6 +63,16 @@ export class SimpleDb {
62
63
resolve ( new SimpleDb ( db ) ) ;
63
64
} ;
64
65
66
+ request . onblocked = ( ) => {
67
+ reject (
68
+ new FirestoreError (
69
+ Code . FAILED_PRECONDITION ,
70
+ 'Cannot upgrade IndexedDB schema while another tab is open. ' +
71
+ 'Close all tabs that access Firestore and reload this page to proceed.'
72
+ )
73
+ ) ;
74
+ } ;
75
+
65
76
request . onerror = ( event : ErrorEvent ) => {
66
77
reject ( ( event . target as IDBOpenDBRequest ) . error ) ;
67
78
} ;
You can’t perform that action at this time.
0 commit comments