tutao / tutanota

Tuta is an email service with a strong focus on security and privacy that lets you encrypt emails, contacts and calendar entries on all your devices.
https://tuta.com
GNU General Public License v3.0
6.1k stars 525 forks source link

Room schema upgrade problem #5319

Closed charlag closed 1 year ago

charlag commented 1 year ago
    Process: de.tutao.tutanota.test:pushprocess, PID: 10788
    java.lang.RuntimeException: Unable to create service de.tutao.tutanota.push.PushNotificationService: java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4498)
        at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2161)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loopOnce(Looper.java:201)
        at android.os.Looper.loop(Looper.java:288)
        at android.app.ActivityThread.main(ActivityThread.java:7872)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
     Caused by: java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.
        at androidx.room.RoomOpenHelper.checkIdentity(RoomOpenHelper.java:154)
        at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.java:135)
        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.java:201)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:427)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:151)
        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:112)
        at androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:706)
        at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:483)
        at de.tutao.tutanota.data.AlarmInfoDao_Impl.getAlarmNotifications(AlarmInfoDao_Impl.java:224)
        at de.tutao.tutanota.push.SseStorage.readAlarmNotifications(SseStorage.kt:54)
        at de.tutao.tutanota.alarms.AlarmNotificationsManager.reScheduleAlarms(AlarmNotificationsManager.kt:23)
        at de.tutao.tutanota.push.PushNotificationService.onCreate(PushNotificationService.kt:79)
        at android.app.ActivityThread.handleCreateService(ActivityThread.java:4485)
        at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2161) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loopOnce(Looper.java:201) 
        at android.os.Looper.loop(Looper.java:288) 
        at android.app.ActivityThread.main(ActivityThread.java:7872) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 

Test notes:

with ios, android, desktop:

ganthern commented 1 year ago

We need to add a migration, but it's difficult to decide what to do.