datastore-idb .query doesn't work as expected
Nobody has claimed this yet.
- #7 by @achingbrain — closed without merging
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- databases
Research direction
Start by tracing store.query and its IndexedDB transaction and cursor lifecycle. Review the linked idb transaction-lifetime explanation, then reproduce a query consumer doing asynchronous work between yielded results. Done means query iteration no longer fails with an inactive-transaction DOMException.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 39
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ipfs/js-stores
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
need/triage
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
need/triage
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
feat: create new core data & blockstore that acts as a cache/buffered storeMay be free again @SgtPooki claimed this 1046 days ago, and no pull request is open. Opendif/medium effort/days kind/enhancement P1 status/in-progress
-
need/triage
Difficulty 1/5 Under an hour Newbie friendliness 45/100
Similar issues
-
area:cli area:security bug priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
"code source" and "numerique.gouv" links: "new window" mention duplicated in the accessible nameOpenaccessibility
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
numerique-gouv/lasuite-landingpage#315 ·
Maintainers usually reply within 1 day
-
needs:triage
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
HyeokjaeChoi/vaultme#585 ·
Maintainers usually reply within 1 day
-
enhancement priority/P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
beettlle/pi-smart-router#200 ·