Skip to content

IndexedDB exception on Firestore batch.commit with latest Firebase SDK 9.6.10 #6110

Closed
@L1b3rtyy

Description

@L1b3rtyy

[REQUIRED] Describe your environment

  • Operating System version: Windows 10, Ubuntu 20.04.3
  • Browser version: Brave V1.36.122, Chrome 99.0.4844.84
  • Firebase SDK version: 9.6.10
  • Firebase Product: firestore

[REQUIRED] Describe the problem

After upgrading from v9.6.9 to v9.6.10 with persistence enabled, some writes result in the following IndexedDB exception:

Uncaught DataError: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's
DOMException: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.
Uncaught DOMException: Failed to execute 'continue' on 'IDBCursor': The parameter is less than or equal to this cursor's position.

@firebase/firestore: Firestore (9.6.10): AsyncQueue Failed to persist write: IndexedDbTransactionError: [code=unavailable]: IndexedDB transaction 'Locally write mutations' failed: AbortError: Uncaught exception in event handler.

And the writes are not propagated to the backend.

Rolling back to v9.6.9 solves the issue.

I would guess this issue is due to the modifications on the IndexedDB data type coming with v9.6.10 as mentioned in the release notes:

Changed the format of some of the IndexedDB data stored by the Cloud Firestore SDK. This increases the performance of document lookups after an initial migration. If you do not want to migrate data, you can call clearIndexedDbPersistence() before invoking enableIndexedDbPersistence().

Note that the issue also occurs in incognito mode so it should not be due to any pre-existing data in IndexedDB or migration issue.

I cannot give a simple reproduction as the case when the write fails is a fairly complex batch operation with multiple writes (delete, set, update) and I have not tested thoroughly v9.6.10 to see if there are simpler cases leading to the same issue. But it is deterministic, in my app I can reproduce it 100% of the time, doing one specific action.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions