Skip to content

datastore-idb .query doesn't work as expected #198

Open
@achingbrain

Description

@achingbrain

store.query opens an IndexedDB transaction and uses a cursor to iterate over each entry in the datastore. The transaction closes automatically when the microtask queue is emptied and there's no outstanding work for it to do, even if the cursor is not at the end of the dataset.

Each query result is yielded to the caller which if they do any async work can cause the transaction to close and the next call to cursor.continue() to throw ERROR: DOMException{stack: 'Error: Failed to execute 'continue' on 'IDBCursor': The transaction is not active..

https://www.npmjs.com/package/idb/v/5.0.2#transaction-lifetime

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions