feat: cancel queued and active SQLite reads
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- javascript, react-native, sqlite
Research direction
Start by tracing the current JavaScript queue and native per-connection FIFO, then read SQLite's sqlite3_interrupt() documentation for cross-thread and transaction behavior. Add coverage for cancellation before admission, while queued in both layers, during a long-running query, and after completion. Done means cancelled reads reject recognizably, only their connection is interrupted, later queries still run, and connection closure remains safe.
Written by the indexing model from the issue text.
Description
Async reads can queue behind an older query even after their caller no longer needs the result. A screen that changes query parameters quickly may therefore wait for several obsolete reads. The current JavaScript queue and native per-connection FIFO have no operation-specific cancellation path.
Add cancellation for asynchronous read queries and prepared-statement reads. A request cancelled before it starts should leave both queues without running SQL. An active request should interrupt only its own connection and reject with a recognizable cancellation error. Handle the race where a query finishes while cancellation is requested, and make sure a late cancellation cannot interrupt the next job. Keep connection closure safe while an interrupt is in flight.
Start with read-only operations. SQLite can roll back an entire explicit transaction when an interrupted write fails, so cancellation of writes, batches, and callback transactions needs a separate contract. Test cancellation before admission, while queued in JavaScript, while queued natively, during a long-running query, and just after completion. Verify that later queries on the same connection still run.
Related: #62. SQLite documents the cross-thread and transaction behavior of sqlite3_interrupt() at https://www.sqlite.org/c3ref/interrupt.html.
- Dominant language
- C
- Stars
- 567
- Forks
- 53
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 67
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
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 margelo/react-native-nitro-sqlite
-
area:api area:runtime enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
margelo/react-native-nitro-sqlite#402 ·
Maintainers usually reply within 1 day
-
area:api area:runtime enhancement
Difficulty 5/5 Over a week Newbie friendliness 28/100
margelo/react-native-nitro-sqlite#401 ·
Maintainers usually reply within 1 day
-
area:api area:runtime enhancement
Difficulty 5/5 Over a week Newbie friendliness 28/100
margelo/react-native-nitro-sqlite#399 ·
Maintainers usually reply within 1 day
-
area:api area:runtime enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
margelo/react-native-nitro-sqlite#398 ·
Maintainers usually reply within 1 day
-
area:api area:runtime enhancement
Difficulty 5/5 Over a week Newbie friendliness 48/100
margelo/react-native-nitro-sqlite#397 ·
Maintainers usually reply within 1 day
All issues in margelo/react-native-nitro-sqlite
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
[stb] Update to 2026-08-02 (stb_image_resize2 2.10 -> 2.18)Possibly taken @tomconder claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Missing zeroOpen
Difficulty 1/5 Under an hour Newbie friendliness 95/100
projecthorus/radiosonde_auto_rx#1116 · 1 comment ·