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 gutenberg_enabled event during rollout #11045

Merged
merged 3 commits into from
Jan 10, 2020

Conversation

maxme
Copy link
Contributor

@maxme maxme commented Jan 6, 2020

Part fix for wordpress-mobile/gutenberg-mobile#1718
There is another upcoming PR for develop but I'm waiting for #11029 to be merged before opening it (code is ready here: https://github.com/wordpress-mobile/WordPress-Android/tree/issue/1718-track-gutenberg-rollout-v2)

Known issue: it's tracked when the network request is initiated, not when we get the response.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@maxme maxme added this to the 13.9 ❄️ milestone Jan 6, 2020
@maxme maxme requested a review from mchowning January 6, 2020 13:56
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jan 6, 2020

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

Copy link
Contributor

@mchowning mchowning 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 to me. I did leave one comment, but I think it is not an issue in practice, so I'll go ahead and approve so you can merge this if you agree.

I actually spent close to an hour unintentionally verifying that the app's "Collect Information" toggle works when it is toggled off. 🤦‍♂️ Once I figured out why my device wasn't sending any analytics though, I was able to verify that with this PR the gutenberg_enabled event is getting properly sent for the progressive rollout with the relevant source property. 🎉

@@ -103,6 +104,15 @@ public static void migrateAppWideMobileEditorPreferenceToRemote(final AccountSto
}
}

private static void trackGutenbergEnabledForNonGutenbergSites(final SiteStore siteStore) {
for (SiteModel site : siteStore.getSites()) {
if (!TextUtils.equals(site.getMobileEditor(), GB_EDITOR_NAME)) {
Copy link
Contributor

@mchowning mchowning Jan 7, 2020

Choose a reason for hiding this comment

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

I think this is really just a theoretical concern related to the known issue that we're tracking when the network request is initiated, but in theory if the dispatch network call (line 85) somehow completed and updated the site object before we got to this if check, would it result in analytics improperly not being sent off because the site's mobile editor would have already been updated?

I have trouble seeing how this could actually happen in practice, but I wanted to mention it in case you think it could occur more easily than I think.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, good point, better to move this before we dispatch the event.

@maxme
Copy link
Contributor Author

maxme commented Jan 10, 2020

@mchowning I moved the analytics tracking code. Can you do a second pass on that one?

@mchowning
Copy link
Contributor

Change look good to me @maxme ! I might include something in the comment about why we're taking the obviously-less-than-ideal approach of not only sending analytics without checking whether the network call succeeded, but actually sending off the event before we even try to make the network call. Obviously, someone could check the commit behind the change and get back to this PR though, so I don't think updating the comment is critical.

@maxme maxme merged commit f8c1c9b into release/13.9 Jan 10, 2020
@maxme maxme deleted the issue/1718-track-gutenberg-rollout branch January 10, 2020 17:30
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