Skip to content

Jetpack Focus: Prepare DeepLinkIntent Receiver to launch open web links flow#17523

Merged
develric merged 12 commits intotrunkfrom
issue/17494-deeplinkreceiver-alias
Nov 24, 2022
Merged

Jetpack Focus: Prepare DeepLinkIntent Receiver to launch open web links flow#17523
develric merged 12 commits intotrunkfrom
issue/17494-deeplinkreceiver-alias

Conversation

@zwarm
Copy link
Copy Markdown
Contributor

@zwarm zwarm commented Nov 23, 2022

Parent #17494

This PR replaces the multiple "new" deep link handlers with "Alias" activities. In addition, the DeepLinkIntentReceiverActivity and DeepLinkIntentReceiverViewModel were refactored to make it easy to drop in the OpenWebLinkWithJetpack overlay dialog.

There was also a fix to enabling/disabling the components based upon the switch in App settings, as they were reversed in the original commit. There are a few minor refactors (see commit messages). Unused classes were removed.

To test:
NOTE: Testing is tricky, so please read through carefully.
Pre: Download the links_helper.zip file from this PR

Test: Ensure that deep links are handled as normal

  • Uninstall all previous versions of JP & WP
  • Install the WP apk from this PR and login
  • Enable the pre-alpha app to handle verified web links links. On a pixel device you will find this under Open By Default > Tap + Add Link > Check all three checkboxes and then click Add.
  • Open the links_helper.html in a browser
  • Tap on the "WordPress.com Stats 1234" link
  • ✅ Verify that the WordPress app was launched
  • Navigate back to the links_helper.html
  • Tap on the "Wordpress Navigations" link under the Prealpha Version Links
  • ✅ Verify that the WordPress app was launched

Test: Ensure that web links no longer open in the app when "open web links with jetpack is enabled

  • Go to My Site -> Me -> App Settings -> Debug settings.
  • Enable open_web_lnks_with_jetpack_flow and restart the app
  • Navigate to Me -> App Settings
  • Enable Open web links with Jetpack setting
  • Open the links_helper.html in a browser
  • Tap on the "WordPress.com Stats 1234" link
  • ✅ Verify that the browser is launched, not the app
  • Navigate back to the links_helper.html
  • Tap on the "Wordpress Navigations" link under the Prealpha Version Links
  • ✅ Verify that the WordPress app was launched

Regression Notes

  1. Potential unintended areas of impact
    Deep links don't work as they once did

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Manual testing. Ran DeepLinkingIntentReceiverViewModelTest and DeepLinkOpenWebLinksWithJetpackHelperTest

  3. What automated tests I added (or what prevented me from doing so)
    Update tests in DeepLinkingIntentReceiverViewModelTest and DeepLinkOpenWebLinksWithJetpackHelperTest
    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.

@zwarm zwarm added this to the 21.3 milestone Nov 23, 2022
@zwarm zwarm requested a review from develric November 23, 2022 18:38
@zwarm zwarm self-assigned this Nov 23, 2022
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Nov 23, 2022

Warnings
⚠️ PR has more than 300 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Nov 23, 2022

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

@wpmobilebot
Copy link
Copy Markdown
Contributor

wpmobilebot commented Nov 23, 2022

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

… so it is more easily mocked. Removed unused mock in test
Copy link
Copy Markdown
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Works as described 👍 , also code LGTM :shipit:

@develric develric merged commit f8e46c3 into trunk Nov 24, 2022
@develric develric deleted the issue/17494-deeplinkreceiver-alias branch November 24, 2022 01:25
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