[Dependency Updates] Update androidxWorkManagerVersion to 2.7.1#17892
[Dependency Updates] Update androidxWorkManagerVersion to 2.7.1#17892
androidxWorkManagerVersion to 2.7.1#17892Conversation
Release Notes: https://developer.android.com/jetpack/androidx/releases/ work#2.7.1
This dependency was added as part of this 82b0c50 commit (see PR below), which supported the use of GCMNetworkManager as a scheduler when Google Play Services is available for API levels <= 22. This was an optional dependency that helped with more reliable and performant background processing on older API versions as GCMNetworkManager on api <= 22 (see 2.2.0 release notes below). However, since this project is now on api >= 24 (see 'minSdkVersion'), this dependency is no longer necessary and thus can be removed. - PR: Issue/10572 update work manager #13542 #13542 - Work Manager 2.2.0: https://developer.android.com/jetpack/androidx/ releases/work#2.2.0 ------------------------------------------------------------------------ Also, the 'Dependency Analysis' plugin advised in favor of that removal, thus, it is most probably safe to do this removal at this point: Dependencies which should be removed or changed to runtime-only: runtimeOnly 'androidx.work:work-gcm:2.7.1' (was implementation)
|
Found 1 violations: The PR caused the following dependency changes:-+--- androidx.work:work-runtime:2.7.0
++--- androidx.work:work-runtime:2.7.1
-+--- androidx.work:work-runtime-ktx:2.7.0
-| +--- androidx.work:work-runtime:2.7.0 (*)
-| +--- org.jetbrains.kotlin:kotlin-stdlib:1.5.30 -> 1.6.21 (*)
-| \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0 -> 1.6.4 (*)
++--- androidx.work:work-runtime-ktx:2.7.1
+| +--- androidx.work:work-runtime:2.7.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.work:work-gcm:2.7.0
-| +--- androidx.work:work-runtime:2.7.0 (*)
-| +--- com.google.android.gms:play-services-gcm:17.0.0
-| | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
-| | +--- androidx.core:core:1.0.0 -> 1.8.0 (*)
-| | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
-| | +--- com.google.android.gms:play-services-base:17.0.0 -> 18.0.1 (*)
-| | +--- com.google.android.gms:play-services-basement:17.0.0 -> 18.1.0 (*)
-| | +--- com.google.android.gms:play-services-iid:17.0.0
-| | | +--- androidx.collection:collection:1.0.0 -> 1.1.0 (*)
-| | | +--- androidx.core:core:1.0.0 -> 1.8.0 (*)
-| | | +--- com.google.android.gms:play-services-base:17.0.0 -> 18.0.1 (*)
-| | | +--- com.google.android.gms:play-services-basement:17.0.0 -> 18.1.0 (*)
-| | | +--- com.google.android.gms:play-services-stats:17.0.0
-| | | | +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
-| | | | \--- com.google.android.gms:play-services-basement:17.0.0 -> 18.1.0 (*)
-| | | \--- com.google.android.gms:play-services-tasks:17.0.0 -> 18.0.1 (*)
-| | \--- com.google.android.gms:play-services-stats:17.0.0 (*)
-| \--- androidx.room:room-runtime:2.2.5 -> 2.4.2 (*)
+--- com.google.firebase:firebase-messaging:21.1.0
-| \--- com.google.android.gms:play-services-stats:17.0.0 (*)
+| \--- com.google.android.gms:play-services-stats:17.0.0
+| +--- androidx.legacy:legacy-support-core-utils:1.0.0 (*)
+| \--- com.google.android.gms:play-services-basement:17.0.0 -> 18.1.0 (*)
Please review and act accordingly
|
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | WordPress | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | ea2c854 | |
|
|||||||||||
| 💡 Scan this QR code with your Android phone to download and install the APK directly on it. | ||
| App | Jetpack | |
| Build Flavor | Jalapeno | |
| Build Type | Debug | |
| Commit | ea2c854 | |
|
LocalNotificationWorker and WeeklyRoundupWorker can be tested through App Settings > Debug settings > Force show Weekly Roundup notification (scroll to the bottom to find it) |
|
👋 @ravishanker !
Oh, I didn't know about this debug setting, this is interesting indeed, thanks for sharing! 💯 But, and please correct me if I am wrong, to my understanding from checking the DebugSettingsViewModel.onForceShowWeeklyRoundupClick() function (and then testing it just to be sure) is that showing weekly roundup notifications like that does flow through the WeeklyRoundupWorker.doWork() function that I am targeting in the tests above, all this debug setting is doing is to show these notifications, right? 🤔 |
Correct, it is just showing a local notification To test if the notification is shown through worker, change the delay here to something like 1 minute: Also, verify in logcat, notifications are scheduled like: WM-SystemJobScheduler: Scheduling work ID 1182934f-f3fc-41f1-954a-43cd9eb3f626 Job ID 1 |
|
👋 @ravishanker !
Great, thanks again for guiding me into that so we can test this feature effectively! 💯 FYI: For completeness purposes, in addition to the above, in order to get that working with something like 1 minute, one would need to also switch off and then back on the As such, with the above addition step, I managed to understand how to test this feature effectively (ish). 🎉 PS: Not that it matters to testing this feature, but for completeness purposes, I was trying to figure out how this one time work manager request makes this weekly roundup notification shown every week. I was trying to find that so as to make this weekly roundup notification show every 1 minute, timeboxed my investigation to 5' mins, but couldn't, I give-up for now... 😅 |
|
Little late to the party, I was at a meetup and I noticed this ping today - I don’t foresee any issue with removing the legacy WM dependency, but take it with a grain of salt as I don't remember much from this part of the codebase :). |
|
Better late than never @malinajirka , much appreciated your input here! 🙇
Same, I am glad we align on that! 🥇
True, will keep an eye on that! 😄 🤞 |


Parent #17564
This PR update
androidxWorkManagerVersionto 2.7.1.Also, this PR removes the extra
androidx.work:work-gcmdependency which adds supported the use ofGCMNetworkManageras a scheduler when Google Play Services is available for API levels <= 22 (ea2c854).PS: @ravishanker I added you as the main reviewer, that is, in addition to the @wordpress-mobile/apps-infrastructure team itself, but not entirely randomly as I am seeing you having some experience on working with these workers/schedulers, and want someone from the WordPress team to be aware of and sign-off on that change for WPAndroid.
To test:
UploadWorker.ktshould be enough):1. UploadWorker.kt
Postscreen.We'll publish the post when your device is back online.2. ReminderWorker.kt
Site Settingsscreen.Bloggingsection, click onReminders, toggle-on every day and click onUpdate.All set!bottom sheet appearing, clickDone.Settingsapp, find theDate & Timesection, turnAutomatic date & timeoff.Blogging Remindersnotification appearing. For example, the notification title could beDaily Prompt, while the notification description something likeIs there anything you feel too old to do anymore?.3. LocalNotificationWorker.kt
CreateSiteNotificationScheduler.scheduleCreateSiteNotificationIfNeeded()function and verified that theLocalNotificationWorker.doWork()function was called after setting the device's date to day/week after today.4. WeeklyRoundupWorker.kt
CreateSiteNotificationScheduler.scheduleCreateSiteNotificationIfNeeded()function and verified that theLocalNotificationWorker.doWork()function was called after setting the device's date to day/week after today.Regression Notes
Potential unintended areas of impact
androidx.work:work-gcmthat got removed might be causing some kind of misbehaviour (see ea2c854). Cc @malinajirka as an extra pair of eyes on that. 🙏What I did to test those areas of impact (or what existing automated tests I relied on)
To testsection above.What automated tests I added (or what prevented me from doing so)
PR submission checklist:
RELEASE-NOTES.txtif necessary.