Fixed multiple busy messages

pull/155/head
M66B 5 years ago
parent a6377486ba
commit 6b7a3c8b37

File diff suppressed because it is too large Load Diff

@ -396,6 +396,7 @@ class Core {
// Add message // Add message
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
try {
if (TextUtils.isEmpty(message.msgid)) if (TextUtils.isEmpty(message.msgid))
throw new IllegalArgumentException("Message ID missing"); throw new IllegalArgumentException("Message ID missing");
@ -504,6 +505,10 @@ class Core {
} finally { } finally {
db.endTransaction(); db.endTransaction();
} }
} catch (Throwable ex) {
db.message().setMessageUid(message.id, null);
throw ex;
}
} }
private static void onMove(Context context, JSONArray jargs, boolean copy, EntityFolder folder, EntityMessage message, Session isession, IMAPStore istore, IMAPFolder ifolder) throws JSONException, MessagingException, IOException { private static void onMove(Context context, JSONArray jargs, boolean copy, EntityFolder folder, EntityMessage message, Session isession, IMAPStore istore, IMAPFolder ifolder) throws JSONException, MessagingException, IOException {

@ -51,7 +51,7 @@ import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory;
// https://developer.android.com/topic/libraries/architecture/room.html // https://developer.android.com/topic/libraries/architecture/room.html
@Database( @Database(
version = 69, version = 70,
entities = { entities = {
EntityIdentity.class, EntityIdentity.class,
EntityAccount.class, EntityAccount.class,
@ -731,6 +731,13 @@ public abstract class DB extends RoomDatabase {
db.execSQL("ALTER TABLE `message` ADD COLUMN `receipt_to` TEXT"); db.execSQL("ALTER TABLE `message` ADD COLUMN `receipt_to` TEXT");
} }
}) })
.addMigrations(new Migration(69, 70) {
@Override
public void migrate(SupportSQLiteDatabase db) {
Log.i("DB migration from version " + startVersion + " to " + endVersion);
db.execSQL("UPDATE message SET uid = NULL WHERE uid < 0");
}
})
.build(); .build();
} }

Loading…
Cancel
Save