Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds: delays for app restart in InAppUpdateManagerImpl #20936

Merged
merged 2 commits into from
Jun 5, 2024

Conversation

pantstamp
Copy link
Contributor

This PR fixes a bug that was discovered after the pe7hp4-R0-p2.

During the flexible flow, when user has accepted the update and it is being downloaded in the background while the app is in the foreground, once it is ready to install, a snackbar appears with a "Restart" action. We want to log an event there before the app is restarted.

This PR adds a delay between the logging of the event the app's restart so the logging have enough time to complete.

cc @oguzkocer


To Test:

Check PR here for more details.

ATTENTION: The current remote config value is 80000. This means that when you try to update a version of the app that is < 80000, the immediate flow will be launched.

To test this feature, we use Internal app sharing as Google suggests here.

Please read how Internal app sharing works here.

ATTENTION: As app bundle links in Internal app sharing might expire, you may need to reupload an app bundle to get a new link to use. The page for uploading is here. If you have the Release apps to testing tracks permission, you’re authorized to upload app bundles and APKs for internal sharing by default. If you don't, you can make a request in Systems P2 like pMz3w-jQU-p2.

  1. Enable internal app sharing on your device following the instructions:
Open the Google Play Store app Google Play.
Tap Menu Menu > Settings.
In the "About" section, tap the Play Store version 7 times.
After the Internal app sharing setting appears, tap the switch to turn on internal app sharing.
Tap Turn on.  
  1. Download the 2 app versions on your computer. Having these versions on your machine will allow you to reupload them as many times as you want and get new links if the old ones have expired. Link here. Upload the 2 files using the page for uploading. Get the 2 links and send them to your device so you can tap on them from there (You could send the links with an email).
  2. Uninstall all versions of the Jetpack app that you have on your device.
  3. Tap on the first link for version 90004.
  4. A Google Play page appears. Tap on the "Install" button. When the download is over, tap on "Open".
  5. Login with a non-automattic account.
  6. From your device, tap the second link for version 90005. You will see a page with an "Update" button. DO NOT tap on it and go back to the app.
  7. Check that nothing happens and no update is shown.
  8. Tap on "Me" button in the bottom navigation bar and tap on "Debug settings".
  9. Enable "in app updates" FF.
  10. Kill and restart the app.
  11. Check that a bottom sheet appears about the update.
  12. Check that the IN_APP_UPDATE_SHOWN event is tracked
  13. Check that the update bottom sheet appears.
  14. Tap "Update" button.
  15. Check that the IN_APP_UPDATE_ACCEPTED event is tracked.
  16. The update is being downloaded in the background.
  17. When the update is downloaded and our app is in the foreground:
    19.Check that a snackbar appears that informs the user and asking for a restart.
  18. Tap on the restart action.
    21. Check that the IN_APP_UPDATE_COMPLETED_WITH_APP_RESTART_BY_USER event is tracked.
  19. Check that the update is installed and the app is restarted.

Attention: If the app is in the background when the update is downloaded, the update is installed silently without notifying the user.

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 4, 2024

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
Versionpr20936-96fb870
Commit96fb870
Direct Downloadjetpack-prototype-build-pr20936-96fb870.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jun 4, 2024

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
Versionpr20936-96fb870
Commit96fb870
Direct Downloadwordpress-prototype-build-pr20936-96fb870.apk
Note: Google Login is not supported on these builds.

Copy link

sonarqubecloud bot commented Jun 4, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 16.66667% with 5 lines in your changes missing coverage. Please review.

Project coverage is 41.06%. Comparing base (7da0f0a) to head (96fb870).
Report is 4 commits behind head on release/25.0.

Files Patch % Lines
...ress/android/inappupdate/InAppUpdateManagerImpl.kt 20.00% 4 Missing ⚠️
...android/inappupdate/InAppUpdateAnalyticsTracker.kt 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release/25.0   #20936      +/-   ##
================================================
- Coverage         41.06%   41.06%   -0.01%     
================================================
  Files              1515     1515              
  Lines             69426    69429       +3     
  Branches          11451    11451              
================================================
+ Hits              28507    28508       +1     
- Misses            38338    38340       +2     
  Partials           2581     2581              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@AjeshRPai AjeshRPai left a comment

Choose a reason for hiding this comment

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

@pantstamp
Tested the PR as per instructions, the event is tracked now

Tracked: in_app_update_completed_with_app_restart

@AjeshRPai AjeshRPai merged commit 721f73d into release/25.0 Jun 5, 2024
20 checks passed
@AjeshRPai AjeshRPai deleted the pantelis/in-app-updates-logging-fixes branch June 5, 2024 05:41
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.

4 participants