Repository navigation
Conversation
There are currently 32 errors related to 'NullSafeMutableLiveData'. All those will get resolved or suppressed locally in subsequent commits.
The 'mutableSnackbarMessage' mutable live data value is set to null during 'onCleared()' and as such it needs to be declared as nullable. Then, using 'let' on the 'snackbarMessage' live data this can be guarded against so that to avoid a null pointer exception.
The 'showErrorMessage' mutable live data value is set to
'event.error.message' on multiple occasions. However, 'event.error' can
be nullable and as such the 'event.error.message' itself.
There is an 'if (event.isError) { ... }' statement above to guard from
that ever happening, but the compiler is not smart enough to understand
that. Maybe with 'Kotlin Contracts' this problem would have been
avoided, but this feature is a separate discussion of its own.
Thus, by guarding this with 'let' before setting this 'showErrorMessage'
mutable live data is the best that can be done at this point of time.
The 'supportedStates' mutable live data value is set to null during 'onCountrySelected(...)' and can be also set to null via the 'OnDomainSupportedStatesFetched.supportedStates' from within the 'SiteStore' as it is actually defined as nullable. As such, the 'supportedStates' itself needs to be declared as nullable.
The 'currentFeatureAnnouncement' mutable live data can be set to null during 'loadFeatures()' and via 'FeatureAnnouncementProvider.getLatestFeatureAnnouncement(...)' which might produce a nullable 'FeatureAnnouncement'. As such, the 'currentFeatureAnnouncement' itself needs to be declared as nullable. The rest of the changes are propagated due to the above change and are mainly guarding the rest of the functionality that depends on that with 'let' and '?' scope functions.
This 'LiveDataExtensions' is not used anywhere within the codebase and as such can be safely remove. If at any point in the future it will be needed again, engineers should either bring it back, with a more model version of it, or use another utility from the 'LiveData' library itself, which will serve the same purpose. This also solves two 'NullSafeMutableLiveData' lint errors related to this function.
Suppress this 'NullSafeMutableLiveData' instead of changing this 'LiveData.mapAsync(...)' extension function and as such its signature seems to be the safest choice at the moment since this extension function is being utilized in extension places.
The 'selectedIds' mutable live data can be set to null during the 'start(...)' and via its 'selectedIds' parameter which is nullable. As such, the 'selectedIds' itself needs to be declared as nullable.
The 'selectedIds' mutable live data can be set to null during the 'start(...)' and via its 'selectedIds' parameter which is nullable. As such, the 'selectedIds' itself needs to be declared as nullable. Although the initial logic was different and what I am describing above, and setting the 'selectedIds' was guarded with 'let' I chose to update this logic and align that with the 'MediaPickerViewModel' logic and the update I did there with my previous commit. Actually, this makes sense as this view model and its associated fragment is treating this 'selectedIds' live data value as nullable already and guarding against it accordingly.
The live data 'cachedPlans' is only utilized from within the view model and as such can be replaced with the '_cachedPlans' mutable live data. This change will make 'cachedPlans' intention much more straightforward.
The 'plans' and 'cachedPlans' mutable live data value can be set to null during 'onPlanOffersFetched(...)' because of the 'OnPlanOffersFetched.planOffers' from within the 'PlansOfferStore' as it is actually defined as nullable. As such, the 'plans' and 'cachedPlans' themselves need to be declared as nullable.
Defaulting to an empty title is enough for this use case.
The 'searchQuery' mutable live data is set to null during 'clearSearch()'. As such, the 'searchQuery' itself needs to be declared as nullable. Also, this view model's associated fragment and activity screens are treating this 'searchQuery' live data value as nullable already and use it as such accordingly.
The 'navigateBack' mutable live data can be set to null during 'cleanupAndFinish()'. As such, the 'navigateBack' itself needs to be declared as nullable. Also, this view model's associated fragment is treating this 'navigateBack' live data value as nullable already and guards against it accordingly.
The 'onNotificationTime' mutable live data can be set to null during 'onNotificationCreated()'. As such, the 'onNotificationTime' itself needs to be declared as nullable. Also, this view model's associated fragment is treating this 'onNotificationTime' live data value as nullable already and guards against it accordingly.
The 'selectedDateChanged' mutable live data is set to null during the 'clear(...)' functions. As such, the 'selectedDateChanged' itself needs to be declared as nullable. Also, this view model's associated fragments are treating this 'selectedDateChanged' live data value as nullable already and guard against it accordingly.
The 'onIntentSelected' mutable live data can be set to null during 'onCustomVerticalSelected()' because of the 'IntentsUiState.searchQuery' as it is actually defined as nullable. As such, the 'onIntentSelected' itself needs to be declared as nullable. However, this view model's associated activity, main view model and interface were expecting a non-nullable intent. But, this can actually change easily and the interface intent can be defined and used as nullable as well. It ends us anyway being using within the 'SiteCreationMainVM.onSiteIntentSelected(...)', which can accept a nullable intent without any problems.
Suppress this 'NullSafeMutableLiveData' instead of changing this 'LiveData.observeEvent(...)' extension function and as such its signature seems to be the safest choice at the moment since this extension function is being utilized in extension places. For more info see 'StatsFragment' and the usage of 'viewModel.siteChanged.observeEvent(...)' which prevents us from changing this easily.
Also, this change moves this 'showSnackbarMessage' backing field closer to it equivalent and associated public live data field.
Suppress this 'NullSafeMutableLiveData' instead of changing this 'LiveData.observeEvent(...)' extension function and as such its signature seems to be the safest choice at the moment since this extension function is being utilized in extension places. For more info see 'StatsViewAllFragment' and the usage of 'viewModel.showSnackbarMessage.observeEvent(...)' which prevents us from changing this easily.
For these classes in this commit the 'NullSafeMutableLiveData' Lint error is suppressed are false positive. It is false positive because the nullability of the variable is already checked before it is assigned to the mutable live data field, but it is anyway ignored as being potentially null and thus reported.
|
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
NullSafeMutableLiveData Lint ErrorsNullSafeMutableLiveData Lint Errors
|
You can test the changes on this Pull Request by downloading the APKs: |
As part of this update the below occurred: - The 'lifecycle-extensions' artifact and APIs got removed as it has been deprecated since '2.2.0' and it is no longer updated. The recommendation nowadays is to instead add dependencies for the specific lifecycle artifacts needed. - Update 'ViewModelProvider.Factory.create(...)' signature to a non-null 'ViewModel' generic as it is now defined as such by the Java factory interface. The above were the only breaking change. Apart from that everything else seems to be compiling and working as expected (did a quick smoke test). However, this update added 10 new 'NullSafeMutableLiveData' lint errors that will be fixed in subsequent commits.
The 'data' mediator live data is set to null during the 'onCleared()'. As such, the 'data' itself needs to be declared as nullable. This use case's associated view model is updated accordingly. Also, this view model's associated fragment is treating this 'uiModel' live data value as nullable already.
The 'searchPages' mutable live data is set to null during 'clearSearch()'. As such, the 'searchPages' itself needs to be declared as nullable. Also, this view model's associated search view model is treating this 'searchPages' live data value as nullable already and guarding against it accordingly.
The 'searchPages' mutable live data is set to null during 'clearSearch()'. As such, the 'searchPages' itself needs to be declared as nullable. Also, this view model's associated search view model is treating this 'searchPages' live data value as nullable already and guarding against it accordingly.
Suppress all 'NullSafeMutableLiveData' instead of changing this 'mergeNotNull(...)' implementation and as such 'showSnackbarMessage' field's signature. This seems to be the safest choice for now.
|
Found 1 violations: The PR caused the following dependency changes: +--- com.automattic:about:0.0.5
| +--- androidx.core:core-ktx:1.7.0
| | \--- androidx.core:core:1.7.0
-| | \--- androidx.lifecycle:lifecycle-runtime:2.3.1
-| | +--- androidx.arch.core:core-runtime:2.1.0
-| | | +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-| | | \--- androidx.arch.core:core-common:2.1.0
-| | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-| | +--- androidx.lifecycle:lifecycle-common:2.3.1
-| | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-| | +--- androidx.arch.core:core-common:2.1.0 (*)
-| | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | \--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1
+| | +--- androidx.arch.core:core-runtime:2.1.0
+| | | +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | | \--- androidx.arch.core:core-common:2.1.0
+| | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | +--- androidx.lifecycle:lifecycle-common:2.4.1
+| | | +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | | \--- androidx.lifecycle:lifecycle-common-java8:2.4.1 (c)
+| | +--- androidx.arch.core:core-common:2.1.0 (*)
+| | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
| +--- com.google.android.material:material:1.4.0 -> 1.6.0-alpha01
| | +--- androidx.appcompat:appcompat:1.1.0 -> 1.3.1
| | | +--- androidx.activity:activity:1.2.4 -> 1.3.1
-| | | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 (*)
+| | | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1 (*)
-| | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1
-| | | | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | | | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1
+| | | | | +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | | | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.10 (*)
| | | | +--- androidx.savedstate:savedstate:1.1.0
-| | | | | \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.3.1 (*)
+| | | | | \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.4.1 (*)
| | | | \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1
-| | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1
-| | | | | +--- androidx.arch.core:core-common:2.1.0 (*)
-| | | | | +--- androidx.arch.core:core-runtime:2.1.0 (*)
-| | | | | \--- androidx.lifecycle:lifecycle-common:2.3.1 (*)
+| | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 -> 2.4.1
+| | | | | +--- androidx.arch.core:core-common:2.1.0 (*)
+| | | | | +--- androidx.arch.core:core-runtime:2.1.0 (*)
+| | | | | \--- androidx.lifecycle:lifecycle-common:2.4.1 (*)
-| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
+| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
| | | +--- androidx.fragment:fragment:1.3.6 -> 1.4.1
| | | | +--- androidx.loader:loader:1.0.0
-| | | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.2.0
-| | | | | | +--- androidx.arch.core:core-runtime:2.1.0 (*)
-| | | | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.2.0 -> 2.3.1 (*)
-| | | | | | \--- androidx.arch.core:core-common:2.1.0 (*)
+| | | | | +--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.4.1
+| | | | | | +--- androidx.arch.core:core-common:2.1.0 (*)
+| | | | | | +--- androidx.arch.core:core-runtime:2.1.0 (*)
+| | | | | | \--- androidx.lifecycle:lifecycle-livedata-core:2.4.1 (*)
-| | | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.3.1 (*)
+| | | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.4.1 (*)
-| | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 (*)
+| | | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 -> 2.4.1 (*)
-| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
+| | | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
-| | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 (*)
+| | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1 (*)
-| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
+| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
-| | \--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.3.1 (*)
+| | \--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.1 (*)
| +--- androidx.compose.ui:ui:1.0.5 -> 1.1.0-beta04
-| | +--- androidx.lifecycle:lifecycle-common-java8:2.3.0
-| | | +--- androidx.lifecycle:lifecycle-common:2.3.0 -> 2.3.1 (*)
-| | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+| | +--- androidx.lifecycle:lifecycle-common-java8:2.3.0 -> 2.4.1
+| | | +--- androidx.lifecycle:lifecycle-common:2.4.1 (*)
+| | | \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-| | +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.3.1 (*)
+| | +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.4.1 (*)
-| | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.3.1 (*)
+| | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.4.1 (*)
| | \--- androidx.profileinstaller:profileinstaller:1.1.0-beta04
-| | \--- androidx.startup:startup-runtime:1.0.0
+| | \--- androidx.startup:startup-runtime:1.0.0 -> 1.1.1
| +--- androidx.compose.ui:ui-tooling:1.0.5
| | +--- androidx.compose.material:material:1.0.5 -> 1.1.0-beta04
-| | | +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.3.1 (*)
+| | | +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.4.1 (*)
-| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.3.1 (*)
+| | | \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.4.1 (*)
| | \--- androidx.activity:activity-compose:1.3.1
| | \--- androidx.activity:activity-ktx:1.3.1
-| | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1
-| | | +--- androidx.lifecycle:lifecycle-runtime:2.3.1 (*)
-| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.20 -> 1.6.10 (*)
-| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1 -> 1.5.2 (*)
-| | | \--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+| | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.4.1
+| | | +--- androidx.lifecycle:lifecycle-runtime:2.4.1 (*)
+| | | +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.10 (*)
+| | | +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.5.2 (*)
+| | | \--- androidx.annotation:annotation:1.0.0 -> 1.2.0
-| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1
-| | +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
-| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.20 -> 1.6.10 (*)
-| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1 -> 1.5.2 (*)
+| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1
+| | +--- androidx.lifecycle:lifecycle-viewmodel:2.4.1 (*)
+| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.10 (*)
+| | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.5.2 (*)
| \--- androidx.navigation:navigation-compose:2.4.0-beta02
| +--- androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01
-| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0 -> 2.3.1 (*)
+| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0 -> 2.4.1 (*)
| \--- androidx.navigation:navigation-runtime-ktx:2.4.0-beta02 -> 2.4.2
| \--- androidx.navigation:navigation-runtime:2.4.2
| +--- androidx.navigation:navigation-common:2.4.2
-| | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 (*)
+| | +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.4.1 (*)
-| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 (*)
+| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
-| +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 (*)
+| \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
+--- com.automattic:stories:1.3.0
| +--- androidx.navigation:navigation-fragment-ktx:2.0.0 -> 2.4.2
| | \--- androidx.navigation:navigation-fragment:2.4.2
| | \--- androidx.fragment:fragment-ktx:1.4.1
-| | +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.3.1
-| | | +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 (*)
-| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.4.20 -> 1.6.10 (*)
+| | +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.3.1 -> 2.4.1
+| | | +--- androidx.lifecycle:lifecycle-livedata-core:2.4.1 (*)
+| | | \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.10 (*)
-| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 (*)
+| | \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
| +--- com.automattic.stories:photoeditor:1.3.0
| | \--- androidx.camera:camera-core:1.0.0-alpha06
-| | +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.2.0 (*)
+| | +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.4.1 (*)
-| | \--- androidx.lifecycle:lifecycle-common:2.1.0 -> 2.3.1 (*)
+| | \--- androidx.lifecycle:lifecycle-common:2.1.0 -> 2.4.1 (*)
-| +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.3.0 (*)
+| +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.4.1 (*)
-| +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-livedata-ktx:2.2.0
-| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.6.10 (*)
-| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0 -> 1.5.2 (*)
-| +--- androidx.lifecycle:lifecycle-livedata:2.2.0 (*)
-| \--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.2.0 -> 2.3.1 (*)
+| \--- androidx.lifecycle:lifecycle-livedata-ktx:2.2.0 -> 2.4.1
+| +--- androidx.lifecycle:lifecycle-livedata:2.4.1 (*)
+| +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.4.1 (*)
+| +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.10 (*)
+| \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.5.2 (*)
+--- project :libs:image-editor:ImageEditor
-| +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-livedata-ktx:2.2.0 (*)
+| \--- androidx.lifecycle:lifecycle-livedata-ktx:2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-extensions:2.2.0
-| +--- androidx.lifecycle:lifecycle-runtime:2.2.0 -> 2.3.1 (*)
-| +--- androidx.arch.core:core-common:2.1.0 (*)
-| +--- androidx.arch.core:core-runtime:2.1.0 (*)
-| +--- androidx.fragment:fragment:1.2.0 -> 1.4.1 (*)
-| +--- androidx.lifecycle:lifecycle-common:2.2.0 -> 2.3.1 (*)
-| +--- androidx.lifecycle:lifecycle-livedata:2.2.0 (*)
-| +--- androidx.lifecycle:lifecycle-process:2.2.0
-| | \--- androidx.lifecycle:lifecycle-runtime:2.2.0 -> 2.3.1 (*)
-| +--- androidx.lifecycle:lifecycle-service:2.2.0
-| | \--- androidx.lifecycle:lifecycle-runtime:2.2.0 -> 2.3.1 (*)
-| \--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 -> 2.3.1 (*)
-+--- androidx.lifecycle:lifecycle-runtime-ktx:2.2.0 -> 2.3.1 (*)
++--- androidx.lifecycle:lifecycle-runtime-ktx:2.4.1 (*)
+--- androidx.work:work-runtime:2.7.0
-| +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.2.0 (*)
+| +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.4.1 (*)
-| +--- androidx.startup:startup-runtime:1.0.0 (*)
+| +--- androidx.startup:startup-runtime:1.0.0 -> 1.1.1 (*)
-| \--- androidx.lifecycle:lifecycle-service:2.1.0 -> 2.2.0 (*)
+| \--- androidx.lifecycle:lifecycle-service:2.1.0
+| \--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.3.1 (*)
++--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-livedata-ktx:2.2.0 (*)
++--- androidx.lifecycle:lifecycle-livedata-ktx:2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-process:2.2.0 (*)
++--- androidx.lifecycle:lifecycle-process:2.4.1
+| +--- androidx.lifecycle:lifecycle-runtime:2.4.1 (*)
+| +--- androidx.startup:startup-runtime:1.1.1 (*)
+| \--- androidx.annotation:annotation:1.2.0
+--- com.automattic:Automattic-Tracks-Android:2.2.0
| \--- io.sentry:sentry-android -> 5.4.3
| \--- io.sentry:sentry-android-core:5.4.3
-| +--- androidx.lifecycle:lifecycle-process:2.2.0 (*)
+| +--- androidx.lifecycle:lifecycle-process:2.2.0 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.3.0 (*)
+| \--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.4.1 (*)
+--- com.google.dagger:dagger-android-support:2.41
-| +--- androidx.lifecycle:lifecycle-common:2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
+| \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
+--- com.google.dagger:hilt-android:2.41
-| +--- androidx.lifecycle:lifecycle-common:2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 (*)
+| \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
+--- org.wordpress:fluxc:{strictly trunk-e8d924793cb408ede0f016e68c5420af0688ff90} -> trunk-e8d924793cb408ede0f016e68c5420af0688ff90
| \--- androidx.paging:paging-runtime:2.1.2
-| +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.3.1 (*)
+| +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.1 (*)
-| \--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.2.0 (*)
+| \--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.4.1 (*)
Please review and act accordingly
|
Suppress this 'NullSafeMutableLiveData' instead of changing this 'MutableLiveData.postOnUi(...)' extension function and as such its signature seems to be the safest choice at the moment since this extension function is being utilized in extension places.
|
👋 @oguzkocer @ashiagr ! FYI: Just in case you missed my previous ping, this PR is now ready for review. 🎉 I updated lifecycle to Please take a look at is and let me know how else I can help you. 🙏 |
ashiagr
left a comment
There was a problem hiding this comment.
I went through this discussion, and am really happy to see lifecycle updated to 2.4.1 with CI passing.
I was able to follow the changes by reading commit messages. I experienced no crashes while smoke testing mentioned areas. Overall I'm confident of approving the changes.
As always, thank you for your thorough work! 🙏
Feel free to merge when you're ready.
| swipeToRefresh = '1.1.0' | ||
| uCropVersion = '2.2.4' | ||
| lifecycleVersion = '2.2.0' | ||
| lifecycleVersion = '2.4.1' |
PS: As part of this PR review and test we should be able to merged #16632 straight to |
|
I'm moving this PR's milestone to
I was tempted to merge this as I saw this was approved, but given this comment + since the troubles Petros had on Friday's release finalization domino'd into postponing the finalization and thus the code freeze today, I'm now too late in my day to wait any further to give a chance for this to land before I start the freeze; but feel free to rebase to the release branch if you feel it's necessary) |
|
👋 @AliSoftware !
Thank you for moving this to the new
Thanks for the communication and for NOT merging this. This indeed doesn't and wouldn't need to be included and rebased to the release branch, so all good from our side. |
|
Thank you for the PR @ParaskP7 and thank you for the review @ashiagr 🙇♂️ I did a very quick look at it and it all makes sense to me. Note that I am not adding an explicit approval because I didn't do a proper review as I have a lot to catch up on and I don't want to block a PR that's already approved. I also took a look at the release notes for |
Related to #16632
This PR deals with the
NullSafeMutableLiveDataLint errors as they suddenly started appearing within the Navigation Component 2.4.2 update PR.Some of these
NullSafeMutableLiveDatawere fixed, while others suppressed. You will find all the details you need in the commit messages themselves as to how a specificNullSafeMutableLiveDatagot resolved. As such, I recommend reviewing this PR commit-by-commit.PS: You will find more info about the decision behind this PR within this conversation.
To test:
All the changes were pretty straightforward and as such don't necessary require much testing. However, I would anyway recommend a quick smoke testing on the below screens and/or functionalities:
Regression Notes
N/ASee
To testsection above.N/APR submission checklist:
RELEASE-NOTES.txtif necessary.