Status Update
Comments
jb...@google.com <jb...@google.com>
cs...@supercharge.io <cs...@supercharge.io> #2
So, the view is something we added recently. It appears that
- removing the view entirely, the destructive migration works. But it doesn't actually remove the view.
- adding the view back in, the destructive migration fails with the same message.
It appears that the destructive migration is not dropping the view, but it does try to create it again, which is what blows up.
I was able to work around this by adding a RoomCallback
and overriding the onDestructiveMigration callback to manually delete the view:
override fun onDestructiveMigration(connection: SQLiteConnection) {
super.onDestructiveMigration(connection)
connection.execSQL("DROP VIEW IF EXISTS calendar_items_view")
}
This is a pretty big potential footgun for anyone using views with destructive migrations!
jb...@google.com <jb...@google.com> #3
This sounds like a bug, with destructive migrations turned ON, views should also be recreated and it seems they are not being dropped before being created again leading to the 'already exists' issue.
cs...@supercharge.io <cs...@supercharge.io> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Daniel Santiago Rivera <
Link:
Drop views during destructive migrations.
Expand for full commit details
Drop views during destructive migrations.
When 'allowDestructiveMigrationForAllTables' is turned ON (default in KMP) it should also drop all views so they can be recreated, this follows the same behaviour as when 'allowDestructiveMigrationForAllTables' is OFF and the RoomDatabase defined views are dropped.
Bug: 381518941
Test: MigrationTest
Change-Id: Iaf27b30b859b3a21f71d252e5c223dfd28365da0
Files:
- M
room/integration-tests/testapp/src/androidTest/java/androidx/room/integration/testapp/migration/MigrationTest.java
- M
room/room-runtime/src/androidMain/kotlin/androidx/room/RoomOpenHelper.android.kt
- M
room/room-runtime/src/commonMain/kotlin/androidx/room/RoomConnectionManager.kt
Hash: 0a3e83009a1f514c7d43870110b63eebb0371efc
Date: Wed Dec 04 10:53:59 2024
ap...@google.com <ap...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-runtime:2.7.0-alpha12
androidx.room:room-runtime-android:2.7.0-alpha12
androidx.room:room-runtime-iosarm64:2.7.0-alpha12
androidx.room:room-runtime-iossimulatorarm64:2.7.0-alpha12
androidx.room:room-runtime-iosx64:2.7.0-alpha12
androidx.room:room-runtime-jvm:2.7.0-alpha12
androidx.room:room-runtime-linuxarm64:2.7.0-alpha12
androidx.room:room-runtime-linuxx64:2.7.0-alpha12
androidx.room:room-runtime-macosarm64:2.7.0-alpha12
androidx.room:room-runtime-macosx64:2.7.0-alpha12
cl...@google.com <cl...@google.com> #6
Fixed externally and will be available in navigation 2.8.5
pr...@google.com <pr...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.9.0-alpha04
androidx.navigation:navigation-runtime:2.9.0-alpha04
androidx.navigation:navigation-common:2.8.5
androidx.navigation:navigation-runtime:2.8.5
il...@google.com <il...@google.com> #9
We've added a note to the release notes - thanks again!
In the future, note that you can add a Relnote:
line in the pull request's description to ensure it gets into the release notes automatically.
ko...@gmail.com <ko...@gmail.com> #10
Thanks! I followed the Relnote:
, maybe it should be added there.
Description
Version used: 2.8.3
@Serializable
class MyRoute(
val platforms: List<Platform>
)
enum class Platform {
ANDROID, IOS
}
composable<MyRoute> { MyScreen() }
This will result in an exception:
java.lang.IllegalArgumentException: Route MyRoute could not find any NavType for argument platforms of type kotlin.collections.ArrayList - typeMap received was {}
Please support list of enums by default.