Skip to content

Migrate GCM Registration Service from JobIntentService to WorkManager - #19701

Merged
ravishanker merged 9 commits into
trunkfrom
Migrate-GCMRegistrationService-from-JobIntentService-to-WorkManager
Nov 30, 2023
Merged

Migrate GCM Registration Service from JobIntentService to WorkManager#19701
ravishanker merged 9 commits into
trunkfrom
Migrate-GCMRegistrationService-from-JobIntentService-to-WorkManager

Conversation

@ravishanker

@ravishanker ravishanker commented Nov 30, 2023

Copy link
Copy Markdown
Contributor

Fixes #16015

This PR migrated JobIntentService to WorkManager for GCM token registration at the startup, and authn stages

JobIntentService is deprecated, and known to cause crashes on low end devices, on below Android 10.


To Test:

Test 1

  • install WP/JP app
  • Login
  • Verify, it works as before

Test 2

  • Logout
  • Login again
  • Verify, works as before

Test 3

  • Delete the app
  • Fresh install the app
  • Go through signup
  • Ensure, everything works as before

Test 4

  • If you have a low end device with Android 10 or below, try reproducing the crash in the issue with current version, and then test with this version to see if it fixes the issue

Regression Notes

  1. Potential unintended areas of impact

    • Login/Signup
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • Tested login, signup, and fresh install
  3. What automated tests I added (or what prevented me from doing so)

    • Existing unit tests

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.

@ravishanker ravishanker added this to the 23.9 milestone Nov 30, 2023
@ravishanker
ravishanker requested a review from irfano November 30, 2023 06:17
@ravishanker ravishanker self-assigned this Nov 30, 2023
@wpmobilebot

wpmobilebot commented Nov 30, 2023

Copy link
Copy Markdown
Contributor
Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr19701-086d1b5
Commit086d1b5
Direct Downloadjetpack-prototype-build-pr19701-086d1b5.apk
Note: Google Login is not supported on these builds.

@wpmobilebot

wpmobilebot commented Nov 30, 2023

Copy link
Copy Markdown
Contributor
WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr19701-086d1b5
Commit086d1b5
Direct Downloadwordpress-prototype-build-pr19701-086d1b5.apk
Note: Google Login is not supported on these builds.

@irfano irfano left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for taking care of this, Ravi! I believe this will significantly improve our crash-free metrics. 🚀
I tested it by attempting to receive push notifications in your test cases, and I successfully received them. Push notifications still work, and the diff LGTM! 👍🏻
I won't merge it now as I've added minor comments for you to review.

Comment thread WordPress/src/main/java/org/wordpress/android/push/GCMRegistrationScheduler.kt Outdated
Comment thread WordPress/src/main/java/org/wordpress/android/push/GCMRegistrationScheduler.kt Outdated
- mark workManager private
- remove unused cancelScheduleRegistration
@wpmobilebot

Copy link
Copy Markdown
Contributor
3 Warnings
⚠️ Class GCMRegistrationScheduler is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class GCMRegistrationWorker is missing tests, but unit-tests-exemption label was set to ignore this.
⚠️ Class Factory is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@ravishanker
ravishanker merged commit 5594c34 into trunk Nov 30, 2023
@ravishanker
ravishanker deleted the Migrate-GCMRegistrationService-from-JobIntentService-to-WorkManager branch November 30, 2023 22:10
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.

RuntimeException: An error occurred while executing doInBackground()

3 participants