You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-06-22] Add Jest test coverage for SQLiteProvider in react-native-onyx #91861
SQLiteProvider is the storage adapter Onyx uses on iOS and Android, built on top of react-native-nitro-sqlite. It owns every read, write, and merge that hits the on-device database — including hand-written SQL, JSON_PATCH/JSON_REPLACE merge logic, parameter binding, and the IN-list batch paths used during sync.
Onyx's existing test suite runs entirely in Node via Jest. Because react-native-nitro-sqlite is a native module with no Node implementation, the suite globally stubs it out in jestSetup.js, so the provider's SQL and merge code never actually executes against a database in CI. Today, the only way to exercise this code is to run the App on a real device or simulator.
Problem
When a developer changes a query, parameter binding, or merge path in SQLiteProvider, it may introduce SQL-shaped bugs (broken JSON_PATCH semantics, mis-bound :value placeholders, escaping mistakes, batch transaction errors). The only way to catch this today is via manual testing — which is slow, inconsistent, and easy to skip. Bugs may ship unnoticed and surface on users' devices.
Proposed Solution
Add a Jest mock of react-native-nitro-sqlite backed by an in-memory better-sqlite3 database, plus a new SQLiteProviderTest.ts that drives the real provider end-to-end against it.
The mock implements the slice of the Nitro surface the provider uses and maps Nitro's positional params onto better-sqlite3's named bindings so existing SQL runs unmodified.
The suite covers: setItem/getItem, multiSet/multiGet, multiMerge (both JSON_PATCH shallow/deep and JSON_REPLACE via replaceNullPatches), removeItem/removeItems, getDatabaseSize, clear, and SQL-injection safety on record_key.
Everything runs on the same CI that already runs the rest of the suite, on every PR — so the next SQL change is caught in seconds instead of in production.
No new patterns introduced: this follows the same approach already used in IDBKeyValProviderTest.
changed the title [-]Add Jest test coverage for SQLiteProvider in react-native-onyx[/-][+][Due for payment 2026-06-22] Add Jest test coverage for SQLiteProvider in react-native-onyx[/+]on Jun 15, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.7-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
Activity
sosek108 commentedon May 28, 2026
PR is ready for review @Julesssss
Expensify/react-native-onyx#794
sosek108 commentedon Jun 1, 2026
Bump PR in E/App: #92085
melvin-bot commentedon Jun 4, 2026
@sosek108 Whoops! This issue is 2 days overdue. Let's get this updated quick!
sosek108 commentedon Jun 8, 2026
Not overdue. Bump in in Onyx update queue
[-]Add Jest test coverage for SQLiteProvider in react-native-onyx[/-][+][Due for payment 2026-06-22] Add Jest test coverage for SQLiteProvider in react-native-onyx[/+]melvin-bot commentedon Jun 15, 2026
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 15, 2026
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.4.7-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2026-06-22. 🎊
For reference, here are some details about the assignees on this issue: