This code will initialize db on Android.
Context in ENG-2071
Details
Tested on emulator and physical device.
- Created malformed db (e.g. simulate bug described in ENG-1910)
- Open the app - should be terminated (on emulator it's not visible, app will start again immediately, but it can be proved via logs)
- Open again - app should delete database and perform soft-logout and continue running with proper structure
Diff Detail
- Repository
- rCOMM Comm
- Branch
- error-handling-4
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
native/android/app/src/cpp/DatabaseInitializerJNIHelper.cpp | ||
---|---|---|
9–10 ↗ | (On Diff #20750) | It is a little confusing to see this order of functions. Can we e.g. make SQLiteQueryExecutor::initialize(sqliteFilePath); a part of initializeQueryExecutor? |
native/android/app/src/main/java/app/comm/android/MainApplication.java | ||
110–111 ↗ | (On Diff #20750) | We have some other places where we have a similar call. Is it safe to have a couple of them? Can we create a function that contains this duplicated logic? |
native/android/app/src/main/java/app/comm/android/MainApplication.java | ||
---|---|---|
110–111 ↗ | (On Diff #20750) | It should be safe: https://linear.app/comm/issue/ENG-2071#comment-0e46f47a I don't think that separating a duplicated "nearly-oneliner" is a game changer, but up to you. |
make initialize part of initializeQueryExecutor
native/android/app/src/cpp/DatabaseInitializerJNIHelper.cpp | ||
---|---|---|
9–10 ↗ | (On Diff #20750) | sure, done |
native/android/app/src/main/java/app/comm/android/MainApplication.java | ||
110–111 ↗ | (On Diff #20750) | According to @bartek comment, I would rather leave it as it is, it is one command so we do not gain much but it might be complicated (see CommCoreJSIModulePackage) where context is different than in other two calls |