feat: cancel queued and active SQLite reads

Offen
#400 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
javascript, react-native, sqlite
Bereich
databases, mobile

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

area:api area:runtime enhancement

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.

Vorherrschende Sprache
C
Sterne
582
Forks
53
Ø Merge
1 T. 17 Std.
Gemergte PRs (30 T.)
10

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus margelo/react-native-nitro-sqlite

Alle Issues in margelo/react-native-nitro-sqlite

Ähnliche Issues

Weitere Issues zu C

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.