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

WooCommerce setup improvements #51932

Merged
merged 4 commits into from
Apr 16, 2021
Merged

Conversation

ilyasfoo
Copy link
Contributor

@ilyasfoo ilyasfoo commented Apr 14, 2021

Changes proposed in this Pull Request

This PR does the following:

  • Fix unintended timeout occurring between engine intervals by destroying the timeout after finding the plugin present.
  • Increasing the plugin installation and activation time limit to 60 seconds.
  • Add a new track calypso_woocommerce_setup_contact_support to better understand user behaviour after experiencing setup timeout or failure.

Testing instructions

  1. Run calypso in your development environment.
  2. Manually induce stalling:
    • Open up client/my-sites/woocommerce/dashboard/required-plugins-install-view.jsx
    • Search for this.props.installAndActivatePlugin( site.ID, plugin );.
    • Comment out the line and wait for calypso to rebuild.
  3. Create a new business site.
  4. Install Hello Dolly plugin to turn it into Atomic site.
  5. Navigate to /woocommerce-installation/{your new site}.
  6. Click on Set up my store!.
  7. Wait for approximately 1 minute, and observe "contact support" screen appearing.
  8. Open up developer console, type in localStorage.setItem( 'debug', 'calypso:analytics*' ) to debug tracks.
  9. Click on "Get in touch"
  10. Observe the track calypso_woocommerce_setup_contact_support is recorded in console containing reason: 'timeout'.

Related to #50833

@ilyasfoo ilyasfoo added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. WooCommerce labels Apr 14, 2021
@matticbot
Copy link
Contributor

@matticbot
Copy link
Contributor

matticbot commented Apr 14, 2021

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

Sections (~49 bytes added 📈 [gzipped])

name                      parsed_size           gzip_size
woocommerce-installation       +230 B  (+0.2%)      +49 B  (+0.1%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Legend

What is parsed and gzip size?

Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@mattsherman mattsherman left a comment

Choose a reason for hiding this comment

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

Changes requested to only log the Tracks event when the "Get in touch" button is actually clicked!

@@ -535,7 +547,13 @@ class RequiredPluginsInstallView extends Component {
title={ translate( "We can't update your store" ) }
subtitle={ subtitle }
>
<Button primary href={ CALYPSO_CONTACT } target="_blank" rel="noopener noreferrer">
<Button
onClick={ this.trackContactSupport( 'failure' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

This calls trackContactSupport() immediately when the contact support message is rendered.

What you want is something like...

onClick={ () => { this.trackContactSupport( 'failure' ) } }

or

onClick={ this.trackContactSupport.bind( this, 'failure' ) }

They both create a new function every time the message is rendered. I'd go with the anonymous arrow function, since I think it is more readable and familiar to newer JS devs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, rookie mistake! Thanks for catching this

@@ -562,7 +580,13 @@ class RequiredPluginsInstallView extends Component {
title={ translate( 'We were unable to set up your store.' ) }
subtitle={ subtitle }
>
<Button primary href={ CALYPSO_CONTACT } target="_blank" rel="noopener noreferrer">
<Button
onClick={ this.trackContactSupport( 'timeout' ) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above.

@mattsherman mattsherman added [Status] Needs Author Reply and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 14, 2021
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Apr 15, 2021
@ilyasfoo
Copy link
Contributor Author

@mattsherman Thanks for reviewing and catching my mistake, I've addressed in c371e33

Copy link
Contributor

@mattsherman mattsherman left a comment

Choose a reason for hiding this comment

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

Nice work! :shipit:

@mattsherman mattsherman added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Apr 15, 2021
@ilyasfoo ilyasfoo merged commit 8422bb4 into trunk Apr 16, 2021
@ilyasfoo ilyasfoo deleted the fix/woocommerce-setup-improvements branch April 16, 2021 02:04
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