Skip to content

Commit e9e5f6b

Browse files
authored
Specify readonly as the default indexeddb transaction mode (#6122)
* Specify readonly as the default indexeddb transaction mode While the mode parameter is optional, the wrapper method will pass `undefined` into the native method if it is not passed into the wrapper. IE11 interprets this as a mode instead of ignoring it and throws an InvalidAccessError. Specifying `readonly` as the default (which is the default if the parameter is omitted) prevents IE11 from crashing during initialization. * Bump patch version for @firebase/util
1 parent e5284a1 commit e9e5f6b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/hungry-owls-hide.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/util': patch
3+
---
4+
5+
Default indexeddb transaction mode to readonly for IE11 compatibility

packages/util/src/indexeddb.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export class DBWrapper {
4242
}
4343
transaction(
4444
storeNames: string[] | string,
45-
mode?: IDBTransactionMode
45+
mode: IDBTransactionMode = 'readonly'
4646
): TransactionWrapper {
4747
return new TransactionWrapper(
4848
this._db.transaction.call(this._db, storeNames, mode)

0 commit comments

Comments
 (0)