Skip to content

[Due for payment 2026-11-10] chore(deps): Upgrade NitroSQLite from 9.8.3 to 10.2.0 #102424

Open

Description

@MelvinBot

Summary

Upgrade react-native-nitro-sqlite from 9.8.3 to the latest release, 10.2.0.

This builds on chore(deps): Update NitroSQLite from 9.6.0 to 9.8.0, whose PR, chore(deps): Update NitroSQLite to 9.8.2, is merged.

Why update

  • Prepared statements. db.prepare(query) prepares SQL once and runs it many times with new parameters. #294
  • Independent DB connections. open({ name, connection: 'independent' }) opens a separate native connection with its own queue, so a reader can run while a writer holds a transaction. #364
  • Performance improvements.
    • Async queries, batches, and file imports enter a per-connection native queue without waiting for the previous result to return through JavaScript. #369
    • Grouped batch parameters reuse a prepared statement, and query results skip an extra native row copy. #387
    • Each connection caches its 32 most recently used statements, async work runs on a dedicated worker thread per connection, and Android writes use fdatasync() and batch atomic writes where supported. #440
  • Node.js mock. react-native-nitro-sqlite/mock runs against better-sqlite3 for tests that need a real SQLite engine. #395

See the full comparison for every change.

Scope

  • Bump react-native-nitro-sqlite to 10.2.0 in App, and in the HybridApp lockfile via Mobile-Expensify#14179.
  • Update the optional NitroSQLite peer dependency range in react-native-onyx to ^10.2.0 via feat(storage): use NitroSQLite 10.2 connections and statements. Onyx currently allows only 9.x, so installing NitroSQLite 10 fails dependency resolution.
  • Rebuild the native apps. Upstream notes these upgrade changes:
    • Existing single-connection calls keep working. Independent connections are opt-in and require SQLITE_THREADSAFE to be non-zero.
    • Deleting a database now fails while another connection still uses the file.
    • Prepared statements must be finalized before their connection closes.
    • A SQL string with more than one statement now throws instead of running only the first statement. #439
    • Query results are plain objects, not Nitro HybridObjects, so they no longer have dispose(), equals(), toString(), or name. #440
Issue OwnerCurrent Issue Owner: @dmkt9

Activity

  1. chrispader commented on Oct 12, 2026

    @chrispader
    Contributor

    @MelvinBot could you assign an Expensify engineer and C+ on this issue and the related PRs?

  2. chrispader commented on Oct 12, 2026

    @chrispader
    Contributor

    @MelvinBot also update the issue to v10.2.0

  3. MelvinBot commented on Oct 12, 2026

    @MelvinBot
    ContributorAuthor

    I picked the engineer and C+ who handled the 9.8.x update. NicolasBonet was the engineer on chore(deps): Update NitroSQLite from 9.6.0 to 9.8.0, and ikevin127 reviewed its PR as C+.


    view run

  4. changed the title [-]chore(deps): Upgrade NitroSQLite from 9.8.2 to 10.0.0[/-] [+]chore(deps): Upgrade NitroSQLite from 9.8.3 to 10.2.0[/+] on Oct 12, 2026
  5. MelvinBot commented on Oct 12, 2026

    @MelvinBot
    ContributorAuthor

    I updated the issue to target NitroSQLite v10.2.0.

    • Title: The title now reads "Upgrade NitroSQLite from 9.8.3 to 10.2.0". App main already uses 9.8.3, so the starting version changed too.
    • Why update: I added the 10.1 and 10.2 performance work and the Node.js mock.
    • Scope: I linked the Onyx PR and the new Mobile-Expensify lockfile PR, Mobile-Expensify#14179.
    • Upgrade notes: I added the two 10.2 breaking changes. A SQL string with more than one statement now throws. Query results are now plain objects, not Nitro HybridObjects.

    view run

  6. NicolasBonet commented on Oct 19, 2026

    @NicolasBonet
    Contributor

    @chrispader could you please let me know how much is pending to complete this?

  7. chrispader commented on Oct 19, 2026

    @chrispader
    Contributor

    @chrispader could you please let me know how much is pending to complete this?

    I have still to address the latest review comments by @ikevin127 and @fabioh8010 and finalize my benchmark results for this Onyx change in Expensify/react-native-onyx#851 (review)

    After the Onyx PR is merged, i'll ping you on the E/App PR 🙌🏼

  8. NicolasBonet commented on Oct 26, 2026

    @NicolasBonet
    Contributor

    @chrispader same question for this week 😅

  9. chrispader commented on Oct 26, 2026

    @chrispader
    Contributor

    @NicolasBonet all issues are addressed and benchmarks were positive! We have to wait for prior Onyx bump PRs #102135 & #103208 to be merged, after that i'm going to resolve conflicts, do a last check and then we're good to go!

  10. NicolasBonet commented on Oct 26, 2026

    @NicolasBonet
    Contributor

    Thank you @chrispader 🙏

  11. 13 remaining items

  12. dmkt9 commented on Nov 6, 2026

    @dmkt9
    Contributor

    Contributor+ Checklist:

    • [Contributor] The offending PR and associated issue have been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to the comment on the PR: N/A (upgrade the library)
      Link to the comment on the Issue: N/A (upgrade the library)

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

    Regression Test Proposal

    Test:

    1. Open an existing chat.
    2. Send a message.
    3. Edit the message.
    4. Force-close the app.
    5. Reopen the app. Verify the edited message appears once and the previous chat history is still visible.

    Do we agree 👍 or 👎

  13. chrispader commented on Nov 9, 2026

    @chrispader
    Contributor
  14. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed on Nov 9, 2026
  15. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  16. melvin-bot commented on Nov 9, 2026

    @melvin-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  17. melvin-bot commented on Nov 12, 2026

    @melvin-bot

    @mallenexpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

  18. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Claude posting on behalf of Matt:

    Ready. Job price: $175 (standard, no Help Wanted, assigned 2026-11-04).

    • dmkt9 (C+): 100%, via NewDot
    • chrispader (agency): no payment

    No deploy blockers or regressions on the issue or the PR.

    Next: press Caps+Y, then pay.

    Evidence
    • C+ checklist, with test steps: comment
    • TestRail case: none yet
    • Resolving PR: #102422 by chrispader, merged 2026-11-02, approved by NicolasBonet, dmkt9. No revert.
    • Test videos: C+ 2/5.
    • Open thread: chrispader says Mobile-Expensify PR 14179 still needs to merge: comment

    PAYPREP v1

  19. mallenexpensify commented on Nov 13, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @dmkt9 due $175 via Upwork

    @dmkt9 can you please accept the job below? Please reply here and tag me once you have.
    https://www.upwork.com/jobs/~022121383388879682509

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions