Skip to content

Issue/13328 13329 backup restore tracking#13947

Merged
zwarm merged 14 commits intodevelopfrom
issue/13328-13329-backup-restore-tracking
Feb 4, 2021
Merged

Issue/13328 13329 backup restore tracking#13947
zwarm merged 14 commits intodevelopfrom
issue/13328-13329-backup-restore-tracking

Conversation

@zwarm
Copy link
Copy Markdown
Contributor

@zwarm zwarm commented Feb 3, 2021

Parent #13328 & 13329

This PR adds tracking to the backup download and restore flows.

Removing the DRAFT label - questions have been clarified
(1) Which errors should be tracked ** ONLY Errors that are shown to the user **

  • Response errors from post requests
  • Other request running - is this really an error? Yes, it is
  • Response errors from fetching status
    Missing/null parameters

(2) Request types and escaped strings

  • Turning a json object into a string prints escaped quotes - not sure this is the format we want to track
    JSON is good to send.

To test:

  • Launch App
  • Turn on feature flags for backup download, restore, and backup
  • Turn on collection information (Me -> App Settings -> Privacy Settings -> Collection information switch)

  • Navigate to the Activity Log
  • Tap on more menu for an item
  • Tap on the Restore to this point option
  • Check log for 🔵 Tracked: jetpack_restore_opened, Properties: {"source":"activity_log"}
  • Tap on Restore Site
  • Tap on Confirm
  • Check log for 🔵 Tracked: jetpack_restore_confirmed, Properties: {"restore_types":"{"sqls":true,"themes":true,"contents":true,"plugins":true,"roots":true,"uploads":true}"}
  • Tap on Let me know when finished button
  • Check log for 🔵 Tracked: jetpack_restore_notify_me_button_tapped

  • Navigate to the Backup
  • Tap on more menu for an item
  • Tap on the Restore to this point option
  • Check log for 🔵 Tracked: jetpack_restore_opened, Properties: {"source":"backup"}
  • Close out of restore

  • Navigate to the Activity Log
  • Tap on more menu for an item
  • Tap on the Download Backup point option
  • Check log for 🔵 Tracked: jetpack_backup_download_opened, Properties: {"source":"activity_log"}
  • Tap on Create downloadable file
  • Check log for 🔵 Tracked: jetpack_backup_download_confirmed, Properties: {"restore_types":"{"sqls":true,"themes":true,"contents":true,"plugins":true,"roots":true,"uploads":true}"}
  • Wait for process to finish
  • Tap on Share Link Button
  • Check log for 🔵 Tracked: jetpack_backup_download_share_link_tapped
  • Tap on Download File Button
  • Check log for 🔵 Tracked: jetpack_backup_download_file_download_tapped
  • Close out of Backup Download

  • Navigate to Backup
  • Tap on more menu for an item
  • Tap on the Download Backup point option
  • Check log for 🔵 Tracked: jetpack_backup_download_opened, Properties: {"source":"backup"}
  • Close out of backup download

  • Navigate to the Activity Log
  • Tap on more menu for an item
  • Tap on the Download Backup point option
  • Tap on Create downloadable file
  • Check log for 🔵 Tracked: jetpack_backup_download_notify_me_button_tapped
  • Close out of Backup Download

PR submission checklist:

  • I have considered adding unit tests where possible.
  • 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 16.7 milestone Feb 3, 2021
@zwarm zwarm requested review from a team and ashiagr and removed request for a team February 3, 2021 00:56
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 3, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Feb 3, 2021

You can test the changes on this Pull Request by downloading the APK here.

@ashiagr ashiagr self-assigned this Feb 3, 2021
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

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

👋 @zwarm, I saw all mentioned track events. I was wondering if we should include blog id with these events. Or is it sufficient that it gets logged when we open activity log?

Also (not related to this PR) I noticed this crash when I clicked notify me button in restore flow:

java.lang.NullPointerException: null cannot be cast to non-null type kotlin.Long
        at org.wordpress.android.ui.jetpack.restore.RestoreViewModel.onNotifyMeClick(RestoreViewModel.kt:494)
        at org.wordpress.android.ui.jetpack.restore.RestoreViewModel.access$onNotifyMeClick(RestoreViewModel.kt:96)
        at org.wordpress.android.ui.jetpack.restore.RestoreViewModel$buildProgress$1.invoke(RestoreViewModel.kt:215)
        at org.wordpress.android.ui.jetpack.restore.RestoreViewModel$buildProgress$1.invoke(RestoreViewModel.kt:96)
        at org.wordpress.android.ui.jetpack.common.viewholders.JetpackButtonViewHolder$updateState$1.onClick(JetpackButtonViewHolder.kt:39)

Regarding tracking errors, let's discuss and finalise them over Slack.

@zwarm
Copy link
Copy Markdown
Contributor Author

zwarm commented Feb 3, 2021

Also (not related to this PR) I noticed this crash when I clicked notify me button in restore flow:

Excellent, I know what it is and will address today. I fixed the crash in 4378c75

Regarding tracking errors, let's discuss and finalise them over Slack.

👍 - yep, loving the "Draft" PR :) Thanks for the review. @ashiagr I had posted the q's in the sheet last night and Jirka answered there.

  • JSONObject is fine for types
  • Error tracking is for ANY error that we show to the user.

@ashiagr - I am moving this from a draft to a PR because it's good to go now. Thanks.

@zwarm zwarm marked this pull request as ready for review February 3, 2021 15:37
@ashiagr ashiagr self-requested a review February 4, 2021 08:25
Copy link
Copy Markdown
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

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

Thanks @zwarm, approving it now.

@zwarm zwarm merged commit 0e4f29b into develop Feb 4, 2021
@zwarm zwarm deleted the issue/13328-13329-backup-restore-tracking branch February 4, 2021 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants