Fixed
Status Update
Comments
se...@google.com <se...@google.com> #2
This is a Room feature request, not one for WorkManager.
or...@gmail.com <or...@gmail.com> #3
WorkManager needs to add a destructive 2 to 1 migration.
or...@gmail.com <or...@gmail.com> #4
The way we're thinking, if a downgrade isn't specified, it should be destructive by default in Room.
se...@google.com <se...@google.com> #5
i think it makes sense for downgrades, at least we can make this another flag.
or...@gmail.com <or...@gmail.com> #6
Would it be possible for WorkManager to use the currently available fallbackToDestructiveMigration() method for its database until the Room API is built and available in a stable release? It should be possible to manually check the forward migrations to make sure they are covered.
il...@google.com <il...@google.com> #7
actually it could have a dummy migration for +1,+2,+3,+4 versions that does this destructive migration manually.
Description
Version used:1.1.0-alpha03
Devices/Android versions reproduced on:
as per
After updating to androidx.fragment:fragment-testing v1.0-alpha03 we're now getting following crash at end of test.
```
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Collection java.util.concurrent.ConcurrentHashMap.values()' on a null object reference
at androidx.lifecycle.ViewModel.clear(ViewModel.java:125)
at androidx.lifecycle.ViewModelStore.clear(ViewModelStore.java:62)
```
Importantly this is test where we're mocking instance of ViewModel being used and issues seems to be related to associated changes to lifecycle-viewmodel v2.1.0-alpha01 which we now have a transitive dependency to. Specifically crash is occurring in following method because mBagOfTags is null
```
final void clear() {
mCleared = true;
for (Object value: mBagOfTags.values()) {
// see comment for the similar call in setTagIfAbsent
closeWithRuntimeException(value);
}
onCleared();
}
```
repo steps:
clone
checkout `fragment_test_issue ` branch
run `RouteListFragmentTest`