Local SQLite store can't open on Linux desktop #82
Description
The app uses sqflite for the local store, but sqflite only ships Android and Apple implementations. sqflite_common_ffi is a dev dependency only, and nothing in lib/ sets databaseFactory for Linux/Windows. So on the Linux desktop build, AppDatabase.open() should fail on the first call.
Found while reading the code for #81. Not reproduced on a real Linux build yet.
Impact if confirmed:
- local mode ("Use offline") can't save anything on Linux
- in connected mode, fix: data-loss, sync and concurrency bugs from a QA pass #81 makes the local store the durable copy of every edit. Without it, Linux falls back to sending saves straight to the backend (the old behavior). So a desktop close with the backend down can still lose the last edit there.
Likely fix: init FFI in main() on Linux/Windows (sqfliteFfiInit(); databaseFactory = databaseFactoryFfi;) and move sqflite_common_ffi to dependencies. Needs a packaging decision first: sqlite3 3.x downloads a prebuilt SQLite through a build hook by default, which matters for F-Droid and offline builds. The other options are its system source, which links the distro's libsqlite3, or bundling.
Expected: notes save locally on Linux, in local mode and as the durable copy in connected mode, the same as on Android.
Activity