Closed 0xDB closed 3 years ago
I think both solutions are reasonable and more or less easy to implement.
1) Simple Sanity check: When opening the db fails or the ticks tables is not present, abort early and do not clear the current db 2) Auto-backup before import
IMO 1) is a necessity
Do you have time to implement this for this issue or should I merge & release the fix now?
I added a sanity check that tests whether the import file is a valid sqlite3 db and whether the ticks table exists + unit test for both cases. Sorry for the many white space changes, Android Studio apparently felt the need to reformat indentation in the files I was working on.
Nice work! I'll release a new version tomorrow.
Fixed issue #136 by adding mimetype "application/octet-stream", tested on Pixel 3 with Android 11. I also fixed the com.android.support deprecation warning and added .debug applicationIdSuffix to be able to run debug and release app on same device/avd.
The mimetype fix also allows import of non-sqlite files, which result in an empty track list. Since import still works and the app doesn't crash, the user can retry with the correct import file, but all previous data is lost in the process. Should we implement sanity checks for the import (such as checking the Magic Header String or comparing the schema) or store the old db to allow the user to roll back the change?