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

Track Load WordPress screen events and content export events #19719

Merged
merged 3 commits into from
Dec 5, 2022

Conversation

salimbraksa
Copy link
Contributor

@salimbraksa salimbraksa commented Dec 4, 2022

Part of #19701 and #19640

Description

This PR adds tracking of the following migration events:

  • contentExportEligibility: Fired on the WordPress side to indicate whether the app can export the content or not.
  • contentExportSucceeded: Fired on the WordPress side when the content export succeeds
  • contentExportFailed: Fired on the WordPress side when the content export fails
  • loadWordPressScreenShown: Fired on the Jetpack side when the "Load WordPress" screen appears
  • loadWordPressScreenOpenTapped: Fired on the Jetpack side when the "Load WordPress" screen "Open WordPress" button tapped
  • loadWordPressScreenNoThanksTapped: Fired on the Jetpack side when the "Load WordPress" screen "No Thanks" button tapped

Test Instructions

Load WordPress Screen Events

Display Load WordPress Screen

  1. Clean install the WordPress app and authenticate.
  2. Exit the WordPress app and don't reopen it. (This will prevent the pre-flight sequence from running)
  3. Clean install the Jetpack app and keep it attached to the debugger.
  4. Expect: UI to be shown explaining to the user they can open WordPress
  5. Expect: These console logs to show up
🔵 Tracked: migration_content_export_eligibility <eligible: false>
🔵 Tracked: migration_content_import_eligibility <eligible: true>
🔵 Tracked: migration_wordpressapp_detected <compatible: true>
🔵 Tracked: migration_content_import_failed <error_type: The data wasn't ready to import>
🔵 Tracked: migration_load_wordpress_screen_shown <>
Case 1: Tapping Open WordPress Button

  1. Tap "Open WordPress" button
  2. Expect: WordPress to load into the foreground temporarily, and then the Jetpack app is brought back to the foreground.
  3. Expect: The migration view to be shown in Jetpack.
  4. Expect: These console logs to show up
🔵 Tracked: migration_load_wordpress_screen_open_tapped <>
🔵 Tracked: migration_wordpressapp_detected <compatible: true>
🔵 Tracked: migration_content_import_succeeded <>
🔵 Tracked: migration_email_triggered <>
🔵 Tracked: migration_welcome_screen_shown <>
🔵 Tracked: migration_email_sent <>

Case 2: Tapping No Thanks Button

  1. Tap "No Thanks" button
  2. Expect: The Jetpack Prologue screen to appear
  3. Expect: These console logs to show up
🔵 Tracked: migration_load_wordpress_screen_no_thanks_tapped <>

Content Export Events

  1. Build and run WordPress app and keep it attached to debugger
  2. Go to any Jetpack powered feature ( e.g Notifications screen )
  3. Tap "Jetpack Powered" badge
  4. Tap "Try the new Jetpack app"
  5. Expect: These console logs to show up
🔵 Tracked: migration_content_export_succeeded <>

Regression Notes

  1. Potential unintended areas of impact
    None.

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

  3. What automated tests I added (or what prevented me from doing so)
    None.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • 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.

UIApplication.shared.open(schemeUrl)
}
actions.secondary = { [weak self] in
loadWordPressViewController.dismiss(animated: true) {
actions.secondary = { [weak self, weak loadWordPressViewController] in
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding [weak loadWordPressViewController] to break a reference cycle between the secondary action handler and loadWordPressViewController.

Without the weak reference, the memory would look like this:

loadWordPressViewController -> loadWordPressViewModel -> actions.secondary -> loadWordPressViewController

a -> b means a owns b

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for spotting this! I'd had a hunch something in this area would cause a reference cycle but didn't go back to investigate.

@wpmobilebot
Copy link
Contributor

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19719-fbf9a21 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19719-fbf9a21 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@salimbraksa salimbraksa marked this pull request as ready for review December 5, 2022 10:56
@peril-wordpress-mobile
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 4 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

Copy link
Contributor

@dvdchr dvdchr left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

Copy link
Contributor

@alpavanoglu alpavanoglu left a comment

Choose a reason for hiding this comment

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

Looks good!

Comment on lines +36 to +39
case .ineligible: return "Content export is ineligible"
case .exportFailure: return "Content export failed"
case .localDraftsNotSynced: return "Local drafts not synced"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not that it matters but I think general style if it exists is to put them on new lines 😀

@salimbraksa
Copy link
Contributor Author

Thanks @alpavanoglu and @dvdchr for your review 🙇

@salimbraksa salimbraksa merged commit 3b1cd08 into release/21.3 Dec 5, 2022
@salimbraksa salimbraksa deleted the task/track-migration-export-events branch December 5, 2022 12:16
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.

5 participants