-
Notifications
You must be signed in to change notification settings - Fork 4k
chore(deps): Update NitroSQLite to 9.8.1 #101437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
89b4221
719b37c
32eea6c
4ad7d28
6151782
71a4151
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -200,7 +200,7 @@ | |
| "react-native-localize": "^3.5.4", | ||
| "react-native-nitro-fetch": "1.5.4", | ||
| "react-native-nitro-modules": "0.36.3", | ||
| "react-native-nitro-sqlite": "9.6.0", | ||
| "react-native-nitro-sqlite": "9.8.1", | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴
void sqliteOpenDb(const std::string& dbName, const std::string& docPath) {
std::lock_guard lifecycleLock(dbLifecycleMutex);
{
std::lock_guard lock(dbMapMutex);
if (dbMap.contains(dbName)) {
throw NitroSQLiteException::DatabaseAlreadyOpen(dbName);
}
}and the JS layer still rejects it before the native call is even reached: // 9.8.1 lib/module/operations/session.js
export function open(options) {
openDatabaseQueue(options.name); // throws "Database OnyxDB is already open."We open // src/libs/ExportOnyxState/index.native.ts
onyxDb = open({name: CONST.DEFAULT_DB_NAME});
This is the exact blocker the deleted
The Fix belongs in Please also add "Troubleshoot → Export Onyx state, verify the share sheet opens with a populated dump" to the Tests section and run it on both platforms.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠
return queueOperationAsync(dbName, () => executeAsyncNative(dbName, query, params));Onyx fans out and expects overlap: return Promise.all(keyChunks.map((keyChunk) => provider.store.executeAsync(command, keyChunk)))On a High Traffic account that is many chunks now running strictly sequentially instead of concurrently on the native pool. Please post a TTI comparison against "Send a message and relaunch" will not surface it.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡
The peer range that would have caught a mismatch was hand-relaxed from I did verify every NitroModules header the generated and hand-written C++ includes exists in the installed none missing, so it looks buildable. That is not proof though, signatures inside those headers can still have moved between The HybridApp bot already asked for one on this PR, so please run AdHoc builds for both iOS and Android (standalone and hybrid) and link them here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟢
app_config = app_package.fetch("nitroSQLite", {})
thread_safe_value = app_config.fetch("threadSafe", true)
performance_mode = app_config.fetch("performanceMode", true)
Two platforms compiling SQLite differently, off defaults we never chose. Suggest pinning them so the build is reproducible and the choice is on the record: "nitroSQLite": {
"threadSafe": true,
"performanceMode": true
} |
||
| "react-native-onyx": "3.0.111", | ||
| "react-native-pager-view": "9.0.4", | ||
| "react-native-pdf": "7.0.2", | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -165,18 +165,12 @@ describe('MoveFilesOutOfDocuments migration (native)', () => { | |
| await expect(MoveFilesOutOfDocuments()).resolves.toBeUndefined(); | ||
| }); | ||
|
|
||
| it('keeps the native database migration patch in sync with the database name', () => { | ||
| const patchDir = path.resolve(__dirname, '../../patches/react-native-nitro-sqlite'); | ||
| const patchFileName = fs.readdirSync(patchDir).find((fileName) => fileName.includes('store-database-outside-documents')); | ||
| expect(patchFileName).toBeDefined(); | ||
| const patchContent = fs.readFileSync(path.join(patchDir, String(patchFileName)), 'utf8'); | ||
|
|
||
| // The patch migrates database files by name at app startup, before any JS runs, so the | ||
| // name is hardcoded there. If the database the app opens is ever renamed, the patch (and | ||
| // this test) must be updated with it, or the migration would silently strand user data. | ||
| expect(patchContent).toContain(`@"${CONST.DEFAULT_DB_NAME}"`); | ||
|
|
||
| it('keeps the Onyx database name aligned with the upstream per-database migration', () => { | ||
| const sqliteProviderContent = fs.readFileSync(path.resolve(__dirname, '../../node_modules/react-native-onyx/dist/storage/providers/SQLiteProvider.js'), 'utf8'); | ||
| expect(sqliteProviderContent).toContain(`'${CONST.DEFAULT_DB_NAME}'`); | ||
|
|
||
| // NitroSQLite now migrates each database when it opens, using the caller's database name. | ||
| const nitroSQLiteContent = fs.readFileSync(path.resolve(__dirname, '../../node_modules/react-native-nitro-sqlite/cpp/hybridObjects/HybridNitroSQLite.cpp'), 'utf8'); | ||
| expect(nitroSQLiteContent).toContain('return migrateDatabase(dbName,'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 I confirmed the string is present in Meanwhile the thing that can actually regress silently is unguarded. if (databaseLocation != nil && ![databaseLocation isEqualToString:@"Documents"]) {
NSLog(@"Invalid RNNitroSQLite_DatabaseLocation value provided (%@). ... Falling back to \"Documents\".", databaseLocation);
}A typo, or someone dropping the key in a future it('keeps the iOS database location opted into Application Support', () => {
const infoPlist = fs.readFileSync(path.resolve(__dirname, '../../ios/NewExpensify/Info.plist'), 'utf8');
// NitroSQLite silently falls back to the user-visible Documents directory when this key is
// missing or misspelled, which would put OnyxDB back in the iOS Files app.
expect(infoPlist).toMatch(/<key>RNNitroSQLite_DatabaseLocation<\/key>\s*<string>ApplicationSupport<\/string>/);
}); |
||
| }); | ||
| }); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢
ios/NewExpensify/Info.plist:98Correct. Key and value match
9.8.1'sios/OnLoad.mm, and the companion PR sets the same pair. Neither plist setsRNNitroSQLite_AppGroup, which matters because the app-group branch returns beforeRNNitroSQLite_DatabaseLocationis ever read.Worth a comment in the plist or a note on the issue so nobody adds an App Group later and quietly reverts the Files-app fix.