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

Set gutenbergEnabled to false if all sites use Aztec #11060

Merged
merged 1 commit into from
Jan 13, 2020

Conversation

mchowning
Copy link
Contributor

@mchowning mchowning commented Jan 8, 2020

Fixes wordpress-mobile/gutenberg-mobile#1714

This fixes an issue that began occurring with the user_info_gutenberg_enabled boolean property to our analytics events. In particular, we switched from sending false if a user was only using Aztec to sending null. iOS did not make this change and continued sending false in that scenario (as did Android until recently). This PR fixes fixes that by setting the gutenbergEnabled metadata to be false if all of a user's sites use Aztec.

Background

This issue occurs because we made a change in July to check to see whether the gutenbergEnabled metadata has been set and only set that property on analytics events if it has been set. At the same time, we also made a change to only update the metadata's gutenbergEnabled property to be true if at least one of the user's sites were using gutenberg. We do not do anything, however, if none of the user's sites use gutenberg. As a result, the gutenbergEnabled metadata property remained unset, and a null value was sent if the user used Aztec on all their sites.

With the changes in this PR, we now only send null if the user has no sites. Otherwise we send true if any of the user's sites use gutenberg (this behavior is unchanged) and we send false if all the user's sites use Aztec (before this change, this would have been sent as null). This should reverse the "swap" that occurred between null and false values in August 2019.

Screen Shot 2020-01-08 at 2 05 43 PM

To test

Scenario 1: No Sites

  1. Log into an account with no sites
  2. Verify that the user_info_gutenberg_enabled property on the analytics events is set to null

Scenario 2: All sites using Aztec

  1. Log into an account where all the associated sites use the Aztec editor
  2. Verify that the user_info_gutenberg_enabled property on the analytics events is set to false

Scenario 3: At least one site using Gutenberg

  1. Log into an account with at least one site using the gutenberg editor (i.e., log into the account used in test scenario 2, and change one site to use gutenberg by default).
  2. Verify that the user_info_gutenberg_enabled property on the analytics events is set to false

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.

Previously, gutenbergEnabled would remain unset.
@mchowning mchowning added this to the 14.0 milestone Jan 8, 2020
@mchowning
Copy link
Contributor Author

👋 @hypest ! You may want to give this a look since you and @daniloercoli were most closely connected to the earlier changes to this code.

@peril-wordpress-mobile
Copy link

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

@mchowning mchowning changed the title Set gutenbergEnabled to false if all sites using Aztec Set gutenbergEnabled to false if all sites use Aztec Jan 9, 2020
Copy link
Contributor

@cameronvoell cameronvoell left a comment

Choose a reason for hiding this comment

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

Change and new tests look good and run correctly for me. Looks good!

One question, I wasn't able to figure out how to execute Scenario 1 from your testing steps. wordpress-mobile/gutenberg-mobile#1714 seems to focus on the wpandroid_editor_session_end event, but I don't think the WP Android app lets you start (or end) an editor session if you do not have any sites (conditions for Scenario 1), so I couldn't trigger this event to test. Is there another relevant event that would send user_info_gutenberg_enabled as null? If not it may be useful to know that no events should be sent with user_info_gutenberg_enabled as null when a user is running an app with this change going forward.

@mchowning
Copy link
Contributor Author

Thanks for the review @cameronvoell ! 🙇

I wasn't able to figure out how to execute Scenario 1 from your testing steps. wordpress-mobile/gutenberg-mobile#1714 seems to focus on the wpandroid_editor_session_end event, but I don't think the WP Android app lets you start (or end) an editor session if you do not have any sites (conditions for Scenario 1), so I couldn't trigger this event to test.

That is a tricky one to test for sure. 😄 The way I validated this was through both (a) checking manual logs I added to the app to verify the property value was null; and (b) checking tracks to insure that the events that were sent off (i.e., wpandroid_application_closed) did not have an unexpected gutenberg enabled value (so in this scenario, that the gutenberg value was null).

Is there another relevant event that would send user_info_gutenberg_enabled as null? If not it may be useful to know that no events should be sent with user_info_gutenberg_enabled as null when a user is running an app with this change going forward.

Events like wpandroid_application_closed, wpandroid_application_opened, and others do get the gutenbergEnabled property attached to them as well, and those events will be sent off even if an account has no sites associated with it (and therefore, the gutenbergEnabled property would be null.

@cameronvoell
Copy link
Contributor

Events like wpandroid_application_closed, wpandroid_application_opened, and others do get the gutenbergEnabled property attached to them as well, and those events will be sent off even if an account has no sites associated with it (and therefore, the gutenbergEnabled property would be null.

Thanks for clarifying that Scenario for me. Ready to merge! :shipit:

@mchowning mchowning merged commit 78cfb88 into develop Jan 13, 2020
@mchowning mchowning deleted the issue/1714_pass_false_for_aztec_instead_of_null branch January 13, 2020 20:38
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.

Analytics for gutenberg enabled switched "false" and "null"
2 participants