Skip to content

[Dependency Updates] Update androidxLifecycleVersion to 2.5.1#17643

Merged
ParaskP7 merged 7 commits intodeps/main-batch-androidx-corefrom
deps/update-androidx-lifecycle-to-2.5.1
Dec 23, 2022
Merged

[Dependency Updates] Update androidxLifecycleVersion to 2.5.1#17643
ParaskP7 merged 7 commits intodeps/main-batch-androidx-corefrom
deps/update-androidx-lifecycle-to-2.5.1

Conversation

@ParaskP7
Copy link
Copy Markdown
Contributor

@ParaskP7 ParaskP7 commented Dec 8, 2022

Parent #17561
Batch Branch: deps/main-batch-androidx-core

🚫 Blocked By:

This PR updates androidxLifecycleVersion to 2.5.1.

Also, as part of this update the below transitive dependencies were added:

  • On the Image Editor module (2d93639):
    • androidx.lifecycle:lifecycle-common
    • androidx.lifecycle:lifecycle-runtime
    • androidx.lifecycle:lifecycle-viewmodel-savedstate
  • On the Editor module (482f47b):
    • androidx.lifecycle:lifecycle-common
    • androidx.lifecycle:lifecycle-runtime
    • androidx.lifecycle:lifecycle-livedata-core
  • On the WordPress module (3cc47ab):
    • androidx.lifecycle:lifecycle-common
    • androidx.lifecycle:lifecycle-runtime
    • androidx.lifecycle:lifecycle-viewmodel
    • androidx.lifecycle:lifecycle-livedata-core
    • androidx.lifecycle:lifecycle-livedata

FYI: @oguzkocer I am mentioning you here so that you are aware that progress on this dependency update, and as such, the whole #17558 parent issue is being paused as #17560 and its kotlinxCoroutinesVersion update to 1.6.4 is now blocking.


In addition to the dependency update commits, a couple of additional test related commits were added to fix a couple of failing tests suites, see below:

  1. Fix conversation notifications view model test.
  2. Fix reader discover view model test.

However, I am still not sure why those tests were passing when AndroidX Lifecycle is on 2.4.1, and only started failing after updating the AndroidX Lifecycle library to 2.5.1. They should have been failing with 2.4.1 as well. My assumption is that the update to 2.5.1 made the library a bit more strict in terms of testing, some bugs related to that got fixed, and thus, things that were previously falsely working are now failing unless the setup is concrete. 🤔

UPDATE: I actually found why this started happening, and it is indeed a bug fix, which actually improves our testing. Thus, this is nothing concerning in terms of those tests starting failing due to a potential change that might be affecting our main sources. See 2.5.0-rc01 release notes (Bug Fixes). Copy-pasted below for ease of reference:

MediatorLiveData.addSource() now throws a NullPointerException when passed a null source instead of
propagating the null source to observers.(Ibd0fb, b/123085232)


PS: @irfano I added you as the main reviewer, that is, in addition to the @wordpress-mobile/apps-infrastructure team itself, but randomly, since I just wanted someone from the WordPress team to be aware of and sign-off on that change for WPAndroid.


To test:

  1. See the dependency tree diff result and verify correctness.
  2. Thoroughly smoke test both, the WordPress and Jetpack apps, and see if they both work as expected.

Merge instructions

  • Wait for Dependency Updates - Main Batch - Kotlin/EventBus #17560 issue to get resolved and the kotlinxCoroutinesVersion update to 1.6.4 merged to trunk.
  • Update PR's base deps/main-batch-androidx-core branch with latest trunk.
  • Update PR with latest deps/main-batch-androidx-core.
  • Remove [PR] Not Ready For Merge] label.
  • Prepare and update PR to a Ready for review state.
  • Assign a reviewer.
  • Merge PR to deps/main-batch-androidx-core.

Regression Notes

  1. Potential unintended areas of impact

    • Potential breakage of screens and core functionality as androidx.lifecycle is a library that is being added as a transitive dependency across lots of androidx and com.google and other libraries.
    • Some of the transitive dependencies added might be causing some kind of misbehaviour.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • See To test section above.
  3. What automated tests I added (or what prevented me from doing so)

    • N/A

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

It is generally recommended that transitively used dependencies should
be declared directly.
It is generally recommended that transitively used dependencies should
be declared directly.
It is generally recommended that transitively used dependencies should
be declared directly.
Release Notes: https://developer.android.com/jetpack/androidx/releases/
lifecycle#2.5.1

------------------------------------------------------------------------

Note that the 'androidxComposeLifecycleVersion' version got also updated
to '2.5.1' since it is currently on the same versioning track as
'androidxLifecycleVersion' itself.

Lifeycle Artifacts: https://developer.android.com/jetpack/androidx/
releases/lifecycle

------------------------------------------------------------------------

As part of this update the '-Xjvm-default=all' Kotlin related free
compiler argument was added because otherwise
the 'StatsViewAllViewModelFactory' class was failing to compile due to
the below error:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Task :WordPress:compileWordpressWasabiDebugKotlin FAILED
e: /Users/.../WordPress-Android/WordPress/src/main/java/org/wordpress
/android/ui/stats/refresh/StatsViewAllViewModelFactory.kt: (64, 7):
Inheritance from an interface with '@JvmDefault' members is only allowed
with -Xjvm-default option
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

For more info see:
- Kotlin Blog: https://blog.jetbrains.com/kotlin/2020/07/
kotlin-1-4-m3-generating-default-methods-in-interfaces/
- Google Issue Tracker: https://issuetracker.google.com/issues/217593040
- Stack Overflow Answer (Ian Lake): https://stackoverflow.com/questions/
70992947/how-do-i-resolve-error-message-inheritance-from-an-interface-
with-jvmdefault

------------------------------------------------------------------------

Also, as part of this change, the below 'kotlinx.coroutines.test'
related imports had to be explicitly added, otherwise the corresponding
tests were failing to compile as those imports are now seen as missing:
- kotlinx.coroutines.test.advanceUntilIdle
- kotlinx.coroutines.test.advanceTimeBy
- kotlinx.coroutines.test.pauseDispatcher
- kotlinx.coroutines.test.resumeDispatcher

PS: 3/4 of the above imports are now deprecated as well. As such, those
need to be updated accordingly. This is going to be done in subsequent
commits. Below are the deprecated imports:
- kotlinx.coroutines.test.advanceTimeBy
- kotlinx.coroutines.test.pauseDispatcher
- kotlinx.coroutines.test.resumeDispatcher

In addition to that, lots of other 'kotlinx.coroutines.test' imports got
deprecated as well, like 'TestCoroutineDispatcher',
'TestCoroutineScope', 'runBlockingTest', etc. All those need to be
dealt with as well.

This probably happened due to a transitive dependency update on
'kotlinx.coroutines', which bumped Coroutines to 1.6.1 for the whole
project, that is, as part of the 'androidx.lifecycle' update to '2.5.1'.
For example see some results below from running this dependencies
'./gradlew WordPress:dependencies' task:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
androidx.lifecycle:lifecycle-runtime-ktx:2.5.1
+--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+--- androidx.lifecycle:lifecycle-runtime:2.5.1 (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 (*)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
androidx.lifecycle:lifecycle-livedata-ktx:2.5.1
+--- androidx.lifecycle:lifecycle-livedata:2.5.1 (*)
+--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.5.1 (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
\--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 (*)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.5.1
+--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 (*)
+--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 (*)

------------------------------------------------------------------------
@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Dec 8, 2022

WordPress📲 You can test these changes on WordPress by downloading wordpress-installable-build-pr17643-fec2420.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppWordPress
Build FlavorJalapeno
Build TypeDebug
Commitfec2420
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Dec 8, 2022

Jetpack📲 You can test these changes on Jetpack by downloading jetpack-installable-build-pr17643-fec2420.apk
💡 Scan this QR code with your Android phone to download and install the APK directly on it.
AppJetpack
Build FlavorJalapeno
Build TypeDebug
Commitfec2420
Note: This installable build uses the JalapenoDebug build flavor, and does not support Google Login.

…mobile/WordPress-Android into deps/update-androidx-lifecycle-to-2.5.1

� Conflicts:
�	WordPress/src/test/java/org/wordpress/android/MainCoroutineScopeRule.kt
�	WordPress/src/test/java/org/wordpress/android/ui/jetpack/scan/ScanViewModelTest.kt
�	WordPress/src/test/java/org/wordpress/android/ui/reader/discover/interests/ReaderInterestsViewModelTest.kt
�	WordPress/src/test/java/org/wordpress/android/ui/reader/repository/ReaderDiscoverDataProviderTest.kt
�	WordPress/src/test/java/org/wordpress/android/util/SnackbarSequencerConcurrentTest.kt
@wpmobilebot
Copy link
Copy Markdown
Contributor

Found 1 violations:

The PR caused the following dependency changes:

 +--- project :libs:analytics
 |    +--- 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 -> 2.4.1
-|    |              |    +--- androidx.lifecycle:lifecycle-runtime: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
-|    |              |    +--- androidx.startup:startup-runtime:1.1.1
-|    |              |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-|    |              |    |    \--- androidx.tracing:tracing:1.0.0
-|    |              |    |         \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-|    |              |    \--- androidx.annotation:annotation:1.2.0
+|    |              +--- androidx.lifecycle:lifecycle-process:2.2.0 -> 2.5.1
+|    |              |    +--- androidx.annotation:annotation:1.2.0
+|    |              |    +--- androidx.lifecycle:lifecycle-runtime:2.5.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.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.lifecycle:lifecycle-common:2.5.1
+|    |              |    |         +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|    |              |    |         \--- androidx.lifecycle:lifecycle-common-java8:2.5.1 (c)
+|    |              |    \--- androidx.startup:startup-runtime:1.1.1
+|    |              |         +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|    |              |         \--- androidx.tracing:tracing:1.0.0
+|    |              |              \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-|    |              +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.4.1
-|    |              |    +--- androidx.lifecycle:lifecycle-common:2.4.1 (*)
-|    |              |    \--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|    |              +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.5.1
+|    |              |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|    |              |    \--- androidx.lifecycle:lifecycle-common:2.5.1 (*)
 |    |              \--- androidx.core:core:1.3.2 -> 1.7.0
-|    |                   \--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1 (*)
+|    |                   \--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.5.1 (*)
 |    \--- androidx.preference:preference:1.1.0
 |         \--- 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 -> 2.4.1 (*)
+|              |    +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.5.1 (*)
-|              |    +--- 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.21 (*)
+|              |    +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.5.1
+|              |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|              |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
+|              |    |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (c)
-|              |    +--- androidx.savedstate:savedstate:1.1.0
-|              |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-|              |    |    +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
-|              |    |    \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.4.1 (*)
+|              |    +--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0
+|              |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|              |    |    +--- androidx.arch.core:core-common:2.1.0 (*)
+|              |    |    +--- androidx.lifecycle:lifecycle-common:2.4.0 -> 2.5.1 (*)
+|              |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.20 -> 1.6.21 (*)
-|              |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1
-|              |         +--- androidx.annotation:annotation:1.0.0 -> 1.2.0
-|              |         +--- androidx.savedstate:savedstate:1.1.0 (*)
-|              |         +--- 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 -> 2.4.1 (*)
+|              |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.5.1
+|              |         +--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+|              |         +--- androidx.core:core-ktx:1.2.0 -> 1.7.0
+|              |         |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.31 -> 1.6.21 (*)
+|              |         |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
+|              |         |    \--- androidx.core:core:1.7.0 (*)
+|              |         +--- androidx.lifecycle:lifecycle-livedata-core:2.5.1
+|              |         |    +--- androidx.arch.core:core-common:2.1.0 (*)
+|              |         |    +--- androidx.arch.core:core-runtime:2.1.0 (*)
+|              |         |    \--- androidx.lifecycle:lifecycle-common:2.5.1 (*)
+|              |         +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 (*)
+|              |         +--- androidx.savedstate:savedstate:1.2.0 (*)
+|              |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
+|              |         \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 -> 1.6.4
+|              |              +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4
+|              |              |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4
+|              |              |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4
+|              |              |         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (c)
+|              |              |         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 (c)
+|              |              |         |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 (c)
+|              |              |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 (*)
+|              |              |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
+|              |              +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4 (*)
+|              |              \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 (*)
 |              +--- androidx.fragment:fragment:1.3.6 -> 1.4.1
-|              |    +--- androidx.core:core-ktx:1.2.0 -> 1.7.0
-|              |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.31 -> 1.6.21 (*)
-|              |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
-|              |    |    \--- androidx.core:core:1.7.0 (*)
+|              |    +--- androidx.core:core-ktx:1.2.0 -> 1.7.0 (*)
 |              |    +--- androidx.loader:loader:1.0.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-livedata:2.0.0 -> 2.5.1
+|              |    |    |    +--- androidx.arch.core:core-common:2.1.0 (*)
+|              |    |    |    +--- androidx.arch.core:core-runtime:2.1.0 (*)
+|              |    |    |    \--- androidx.lifecycle:lifecycle-livedata-core:2.5.1 (*)
-|              |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.4.1 (*)
+|              |    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.0.0 -> 2.5.1 (*)
-|              |    +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 -> 2.4.1 (*)
+|              |    +--- androidx.lifecycle:lifecycle-livedata-core:2.3.1 -> 2.5.1 (*)
-|              |    +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
+|              |    +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.5.1 (*)
-|              |    +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 (*)
+|              |    +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.5.1 (*)
-|              |    \--- androidx.savedstate:savedstate:1.1.0 (*)
+|              |    \--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)
-|              +--- androidx.savedstate:savedstate:1.1.0 (*)
+|              +--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)
-|              +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1 (*)
+|              +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.5.1 (*)
-|              \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
+|              \--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.5.1 (*)
 +--- project :libs:image-editor
 |    +--- com.google.android.material:material:1.2.1 -> 1.6.0-alpha01
-|    |    \--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.1 (*)
+|    |    \--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.5.1 (*)
 |    +--- androidx.navigation:navigation-fragment:2.4.2
 |    |    +--- androidx.fragment:fragment-ktx:1.4.1
 |    |    |    +--- androidx.activity:activity-ktx:1.2.3 -> 1.3.1
-|    |    |    |    +--- 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.21 (*)
-|    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.6.4
-|    |    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4
-|    |    |    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4
-|    |    |    |    |    |    |         +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4
-|    |    |    |    |    |    |         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4 (c)
-|    |    |    |    |    |    |         |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4 (c)
-|    |    |    |    |    |    |         |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 (c)
-|    |    |    |    |    |    |         +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 (*)
-|    |    |    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21
-|    |    |    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4 (*)
-|    |    |    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21 (*)
-|    |    |    |    |    \--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+|    |    |    |    +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.5.1
+|    |    |    |    |    +--- androidx.annotation:annotation:1.0.0 -> 1.2.0
+|    |    |    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.5.1 (*)
+|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
+|    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 -> 1.6.4 (*)
-|    |    |    |    +--- 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.21 (*)
-|    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.6.4 (*)
+|    |    |    |    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.5.1
+|    |    |    |    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 (*)
+|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
+|    |    |    |    |    \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 -> 1.6.4 (*)
 |    |    |    |    \--- androidx.savedstate:savedstate-ktx:1.1.0
-|    |    |    |         \--- androidx.savedstate:savedstate:1.1.0 (*)
+|    |    |    |         \--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)
-|    |    |    +--- 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.21 (*)
+|    |    |    +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.3.1 -> 2.5.1
+|    |    |    |    +--- androidx.lifecycle:lifecycle-livedata-core:2.5.1 (*)
+|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
-|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
+|    |    |    \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.5.1 (*)
 |    |    \--- androidx.navigation:navigation-runtime:2.4.2
 |    |         +--- androidx.navigation:navigation-common:2.4.2
-|    |         |    +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.4.1 (*)
+|    |         |    +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.5.1 (*)
-|    |         |    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
+|    |         |    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.5.1 (*)
-|    |         |    +--- androidx.savedstate:savedstate:1.0.0 -> 1.1.0 (*)
+|    |         |    +--- androidx.savedstate:savedstate:1.0.0 -> 1.2.0 (*)
-|    |         |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 (*)
+|    |         |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.5.1 (*)
-|    |         +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.4.1 (*)
+|    |         +--- androidx.lifecycle:lifecycle-runtime-ktx:2.3.1 -> 2.5.1 (*)
-|    |         \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.4.1 (*)
+|    |         \--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1 -> 2.5.1 (*)
+|    +--- androidx.lifecycle:lifecycle-common:2.5.1 (*)
+|    +--- androidx.lifecycle:lifecycle-runtime:2.5.1 (*)
-|    +--- androidx.lifecycle:lifecycle-viewmodel:2.4.1 (*)
+|    +--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 (*)
-|    \--- androidx.lifecycle:lifecycle-livedata-core:2.4.1 (*)
+|    +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (*)
+|    \--- androidx.lifecycle:lifecycle-livedata-core:2.5.1 (*)
-+--- org.wordpress:fluxc:{strictly trunk-35bc4b0194946cdef6aedf45be77e4f1d6dc6126} -> trunk-35bc4b0194946cdef6aedf45be77e4f1d6dc6126
-|    \--- androidx.paging:paging-runtime:2.1.2
-|         +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.4.1 (*)
-|         \--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.4.1 (*)
-+--- org.wordpress:login:1.0.0
-|    \--- com.google.dagger:dagger-android-support:2.42
-|         +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.4.1 (*)
-|         +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
-|         \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 (*)
-+--- com.automattic:about:1.0.0
-|    +--- androidx.compose.ui:ui:1.0.5 -> 1.1.1
-|    |    +--- androidx.savedstate:savedstate:1.1.0 (*)
-|    |    +--- androidx.lifecycle:lifecycle-common-java8:2.3.0 -> 2.4.1 (*)
-|    |    +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.4.1 (*)
-|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.4.1 (*)
-|    +--- androidx.compose.ui:ui-tooling:1.0.5
-|    |    \--- androidx.compose.material:material:1.0.5 -> 1.1.1
-|    |         +--- androidx.savedstate:savedstate:1.1.0 (*)
-|    |         +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.4.1 (*)
-|    |         \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.4.1 (*)
-|    \--- androidx.navigation:navigation-compose:2.4.0-beta02
-|         \--- androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01 -> 2.4.1
-|              +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0 -> 2.4.1 (*)
-|              +--- androidx.compose.runtime:runtime:1.0.1 -> 1.1.1 (*)
-|              +--- androidx.compose.ui:ui:1.0.1 -> 1.1.1 (*)
-|              \--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.21 (*)
-+--- com.automattic:stories:2.0.0
-|    +--- com.automattic.stories:photoeditor:2.0.0
-|    |    \--- androidx.camera:camera-core:1.0.0-alpha06
-|    |         +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.4.1 (*)
-|    |         \--- androidx.lifecycle:lifecycle-common:2.1.0 -> 2.4.1 (*)
-|    +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.4.1 (*)
-|    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.4.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.21 (*)
-|         \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0 -> 1.6.4 (*)
-+--- androidx.lifecycle:lifecycle-runtime-ktx:2.4.1 (*)
-+--- androidx.work:work-runtime:2.7.0
-|    +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.4.1 (*)
-|    \--- androidx.lifecycle:lifecycle-service:2.1.0
-|         \--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-livedata-ktx:2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-process:2.4.1 (*)
-+--- androidx.compose.runtime:runtime-livedata:1.1.1
-|    \--- androidx.lifecycle:lifecycle-livedata:2.2.0 -> 2.4.1 (*)
-+--- androidx.lifecycle:lifecycle-viewmodel-compose:2.4.1 (*)
-+--- io.coil-kt:coil-compose:1.4.0
-|    \--- io.coil-kt:coil:1.4.0
-|         \--- io.coil-kt:coil-base:1.4.0
-|              +--- androidx.lifecycle:lifecycle-common-java8:2.3.1 -> 2.4.1 (*)
-|              \--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.4.1 (*)
-\--- com.google.dagger:hilt-android:2.42
-     +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.4.1 (*)
-     +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.4.1 (*)
-     +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 (*)
-     \--- androidx.savedstate:savedstate:1.1.0 (*)
++--- project :libs:editor
+|    +--- androidx.lifecycle:lifecycle-common:2.5.1 (*)
+|    +--- androidx.lifecycle:lifecycle-runtime:2.5.1 (*)
+|    \--- androidx.lifecycle:lifecycle-livedata-core:2.5.1 (*)
++--- org.wordpress:fluxc:{strictly trunk-35bc4b0194946cdef6aedf45be77e4f1d6dc6126} -> trunk-35bc4b0194946cdef6aedf45be77e4f1d6dc6126
+|    \--- androidx.paging:paging-runtime:2.1.2
+|         +--- androidx.lifecycle:lifecycle-runtime:2.0.0 -> 2.5.1 (*)
+|         \--- androidx.lifecycle:lifecycle-livedata:2.0.0 -> 2.5.1 (*)
++--- org.wordpress:login:1.0.0
+|    \--- com.google.dagger:dagger-android-support:2.42
+|         +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.5.1 (*)
+|         +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.5.1 (*)
+|         \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.5.1 (*)
++--- com.automattic:about:1.0.0
+|    +--- androidx.compose.ui:ui:1.0.5 -> 1.1.1
+|    |    +--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)
+|    |    +--- androidx.lifecycle:lifecycle-common-java8:2.3.0 -> 2.5.1 (*)
+|    |    +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.5.1 (*)
+|    |    \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.5.1 (*)
+|    +--- androidx.compose.ui:ui-tooling:1.0.5
+|    |    \--- androidx.compose.material:material:1.0.5 -> 1.1.1
+|    |         +--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)
+|    |         +--- androidx.lifecycle:lifecycle-runtime:2.3.0 -> 2.5.1 (*)
+|    |         \--- androidx.lifecycle:lifecycle-viewmodel:2.3.0 -> 2.5.1 (*)
+|    \--- androidx.navigation:navigation-compose:2.4.0-beta02
+|         \--- androidx.lifecycle:lifecycle-viewmodel-compose:2.4.0-rc01 -> 2.5.1
+|              +--- androidx.annotation:annotation-experimental:1.1.0
+|              +--- androidx.compose.runtime:runtime:1.0.1 -> 1.1.1 (*)
+|              +--- androidx.compose.ui:ui:1.0.1 -> 1.1.1 (*)
+|              +--- androidx.lifecycle:lifecycle-common-java8:2.5.1 (*)
+|              +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1 (*)
+|              +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.5.1 (*)
+|              \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
++--- com.automattic:stories:2.0.0
+|    +--- com.automattic.stories:photoeditor:2.0.0
+|    |    \--- androidx.camera:camera-core:1.0.0-alpha06
+|    |         +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.5.1 (*)
+|    |         \--- androidx.lifecycle:lifecycle-common:2.1.0 -> 2.5.1 (*)
+|    +--- androidx.lifecycle:lifecycle-common-java8:2.2.0 -> 2.5.1 (*)
+|    +--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 -> 2.5.1 (*)
+|    \--- androidx.lifecycle:lifecycle-livedata-ktx:2.2.0 -> 2.5.1
+|         +--- androidx.lifecycle:lifecycle-livedata:2.5.1 (*)
+|         +--- androidx.lifecycle:lifecycle-livedata-core-ktx:2.5.1 (*)
+|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 (*)
+|         \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 -> 1.6.4 (*)
++--- androidx.lifecycle:lifecycle-common:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-runtime:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-runtime-ktx:2.5.1 (*)
++--- androidx.work:work-runtime:2.7.0
+|    +--- androidx.lifecycle:lifecycle-livedata:2.1.0 -> 2.5.1 (*)
+|    \--- androidx.lifecycle:lifecycle-service:2.1.0
+|         \--- androidx.lifecycle:lifecycle-runtime:2.1.0 -> 2.5.1 (*)
++--- androidx.lifecycle:lifecycle-viewmodel:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-livedata-core:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-livedata:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-livedata-ktx:2.5.1 (*)
++--- androidx.lifecycle:lifecycle-process:2.5.1 (*)
++--- androidx.compose.runtime:runtime-livedata:1.1.1
+|    \--- androidx.lifecycle:lifecycle-livedata:2.2.0 -> 2.5.1 (*)
++--- androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1 (*)
++--- io.coil-kt:coil-compose:1.4.0
+|    \--- io.coil-kt:coil:1.4.0
+|         \--- io.coil-kt:coil-base:1.4.0
+|              +--- androidx.lifecycle:lifecycle-common-java8:2.3.1 -> 2.5.1 (*)
+|              \--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.5.1 (*)
+\--- com.google.dagger:hilt-android:2.42
+     +--- androidx.lifecycle:lifecycle-common:2.3.1 -> 2.5.1 (*)
+     +--- androidx.lifecycle:lifecycle-viewmodel:2.3.1 -> 2.5.1 (*)
+     +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1 -> 2.5.1 (*)
+     \--- androidx.savedstate:savedstate:1.1.0 -> 1.2.0 (*)

Please review and act accordingly

This failure is expected as the failure occurs because the
'pushNotificationsStatusUpdate' hasn't been configured during the test
setup phases.

For more details see 'NullPointerException' stacktrace below:

------------------------------------------------------------------------
source cannot be null
java.lang.NullPointerException: source cannot be null
    at androidx.lifecycle.MediatorLiveData.addSource
      (MediatorLiveData.java:87)
    at org.wordpress.android.ui.reader.viewmodels.
      ConversationNotificationsViewModel.init
      (ConversationNotificationsViewModel.kt:145)
    at org.wordpress.android.ui.reader.viewmodels.
      ConversationNotificationsViewModel.start
      (ConversationNotificationsViewModel.kt:72)
    at org.wordpress.android.ui.reader.viewmodels.
      ConversationNotificationsViewModelTest.setupObserversAndStart
      (ConversationNotificationsViewModelTest.kt:202)
    at org.wordpress.android.ui.reader.viewmodels.
      ConversationNotificationsViewModelTest.follow ui state is DISABLED
      on start(ConversationNotificationsViewModelTest.kt:62)
------------------------------------------------------------------------

PS: Still, it is a bit weird that this test failure only started to
occur after updating the AndroidX Lifecycle library to 2.5.1.
This failure is expected as the failure occurs because the
'preloadPostEvents' wasn't being configured during the test
setup phases. For more details see 'NullPointerException' stacktrace
below:

------------------------------------------------------------------------
source cannot be null
java.lang.NullPointerException: source cannot be null
    at androidx.lifecycle.MediatorLiveData.addSource
      (MediatorLiveData.java:87)
    at org.wordpress.android.ui.reader.discover.
      ReaderDiscoverViewModel.init(ReaderDiscoverViewModel.kt:162)
    at org.wordpress.android.ui.reader.discover.
      ReaderDiscoverViewModel.start(ReaderDiscoverViewModel.kt:109)
    at org.wordpress.android.ui.reader.discover.
      ReaderDiscoverViewModelTest.init(ReaderDiscoverViewModelTest
     .kt:632)
    at org.wordpress.android.ui.reader.discover.
      ReaderDiscoverViewModelTest.initial uiState is loading
      (ReaderDiscoverViewModelTest.kt:200)
------------------------------------------------------------------------

PS: Still, it is a bit weird that this test failure only started to
occur after updating the AndroidX Lifecycle library to 2.5.1.
@ParaskP7 ParaskP7 requested review from a team and irfano December 21, 2022 13:01
@ParaskP7 ParaskP7 marked this pull request as ready for review December 21, 2022 13:16
Copy link
Copy Markdown
Member

@irfano irfano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff LGTM! Great job, @ParaskP7! 🚀
I didn't see any notable change on the release notes of 2.5.1. JP and WP passed my manual tests for basic features.

MediatorLiveData.addSource() now throws a NullPointerException when passed a null source instead of propagating the null source to observers.(Ibd0fb, b/123085232)

About your comment on failing tests: Your finding is correct, the reason must be the new null check on 2.5.1.

diff-2 4 1-2 5 1

@irfano
Copy link
Copy Markdown
Member

irfano commented Dec 22, 2022

@ParaskP7, in Merge Instructions, there is an item "Merge PR to trunk.", but the target is deps/main-batch-androidx-core. I should merge to deps/main-batch-androidx-core, right?

@ParaskP7
Copy link
Copy Markdown
Contributor Author

👋 @irfano !

The diff LGTM! Great job, @ParaskP7! 🚀
I didn't see any notable change on the release notes of 2.5.1. JP and WP passed my manual tests for basic features.

Thank you for the review, testing and for looking into release notes, you are awesome! 🙇 ❤️ 🚀

About your comment on failing tests: Your finding is correct, the reason must be the new null check on 2.5.1.

Yes! And thank you for digging even deeper than that and sharing the exact code change, you rock! 🥇

@ParaskP7, in Merge Instructions, there is an item "Merge PR to trunk.", but the target is deps/main-batch-androidx-core. I should merge to deps/main-batch-androidx-core, right?

This is my bad, you are right, this PR needs to be merged to deps/main-batch-androidx-core and not trunk, thank you for noticing that, for reading the merge instructions and for not merging, but instead for waiting on my reply. I just update that to point to deps/main-batch-androidx-core instead of merging to trunk. 🔬

@ParaskP7 ParaskP7 merged commit 87610f8 into deps/main-batch-androidx-core Dec 23, 2022
@ParaskP7 ParaskP7 deleted the deps/update-androidx-lifecycle-to-2.5.1 branch December 23, 2022 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants