Closed BubblyNetDev closed 3 years ago
@BubblyNetDev thanks for the report, did you have any data in the database?
I had created a group but not added any nodes or anything else
Right i'll try that then.
Hello Roshan, any news on this issue? Were you able to reproduce?
Hi been a bit busy with some other things unfortunately. I'll try to take a look at this today.
Had the same crash.
Should be because, in MeshNetworkDb.java, you have this method :
private static void addColumnNetworkExclusionList(@NonNull final SupportSQLiteDatabase database) {
database.execSQL("ALTER TABLE mesh_network ADD COLUMN network_exclusions TEXT NOT NULL DEFAULT '{}'");
}
And then migration method is called , which has : private static void migrateMeshNetwork11_12(@NonNull final SupportSQLiteDatabase database) { .. final Cursor cursor = database.query("SELECT * FROM mesh_network"); if (cursor != null && cursor.moveToFirst()) { do { .. final String networkExclusions = cursor.getString(cursor.getColumnIndex("network_exclusions")); .. }
But the new column network_exclusions is not found , and the problem lies in the line : final Cursor cursor = database.query("SELECT * FROM mesh_network");
Reason : there is a known Android bug, for some reason the SELECT, under specific circumnstances, retrieves the table from cache, so you get the old mesh network table, before being altered in the first place in addColumnNetworkExclusionList method .
Fix: stupid and counterintuitive it may sound but just writing select and from in lower case fixes it, try to change the cursor declaration this way : final Cursor cursor = database.query("select * from mesh_network");
@BubblyNetDev sorry for the delayed reply as I have been busy with some other tasks. @Mavericksb I tried your fix and strangely enough it does seem to work. Thanks for taking the time to debug this.
Describe the bug Running new release 3.1.5 after having run 2.1.3 the app crashes with the following exception.
To Reproduce Steps to reproduce the behavior:
Expected behavior App to run, I have checked against later versions and this exception is not thrown from at least 2.4.1 and up. Seems to fail on MIGRATION_11_12, confirmed working when going from 2.1.3 to 3.0.