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

Refresh the site's modules and settings after successful product activation #21886

Merged
merged 4 commits into from
Nov 29, 2021

Conversation

rcanepa
Copy link
Contributor

@rcanepa rcanepa commented Nov 26, 2021

Fixes 1201096622142517-as-1201431693192886

Changes proposed in this Pull Request:

  • Adds a call to fetchModules and fetchSettings after successful activation of a product. We need these calls to provide a consistent UX that is aligned with the user's expectations. For example, after a user purchases Jetpack Complete, they will expect to have the search feature enabled and working. Without these calls, the user would have to refresh the page to see that. This PR prevents that.

Note: there is a known issue that affects the activation of Jetpack Complete. Particularly, the request to activate the license times out. You can bypass that by increasing the timeout from 10 to 20-30 seconds in the projects/packages/connection/src/class-client.php file (line 82).

Jetpack product discussion

  • Project Thread: p1HpG7-cSg-p2

Does this pull request change what data or activity we track or use?

  • Not at all.

Testing instructions:

  • Spin up a site using this Jetpack branch.
  • Connect Jetpack to your A8C WordPress.com account.
  • Enable the A8c Proxy.
  • Go to https://cloud.jetpack.com/pricing.
  • Select Jetpack Complete.
  • Complete checkout.
  • On the "Thank you for purchase!" page, just stop there.. (Don't enter a site URL in the input box).
  • On your site, visit /wp-admin/admin.php?page=jetpack#/license/activation.
  • Enter the license key associated with your Jetpack Complete purchase (you can get it from SA).
  • Activate the product.
  • Once the activation finishes, do not refresh the page.
  • Click on Jetpack > Dashboard (sidebar).
  • Click on the My Plan tab.
  • Verify that you see Jetpack Complete in the My Plan section.
  • Verify that you see Instant search and filtering card just below that.
  • Go to Jetpack > Settings (sidebar).
  • Click on the Performace tab.
  • Verify that Search and Instant Search Experience are enabled.
JetpackCompleteActivation.mp4

@rcanepa rcanepa added [Status] Needs Team Review [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ labels Nov 26, 2021
@rcanepa rcanepa added this to the jetpack/10.4 milestone Nov 26, 2021
@rcanepa rcanepa requested a review from a team November 26, 2021 20:36
@rcanepa rcanepa self-assigned this Nov 26, 2021
@github-actions github-actions bot added the Admin Page React-powered dashboard under the Jetpack menu label Nov 26, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: December 7, 2021.
  • Scheduled code freeze: November 30, 2021.

Copy link
Contributor

@elliottprogrammer elliottprogrammer left a comment

Choose a reason for hiding this comment

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

Yes this works as expected. Jetpack Complete shows as the active plan and Instant search and filtering is enabled (automatically, without refreshing the page) after activating the Jetpack Complete license.
LGTM! 👍

@elliottprogrammer elliottprogrammer added [Status] Needs Review To request a review from Crew. Label will be renamed soon. and removed [Status] Needs Team Review labels Nov 29, 2021
@oskosk
Copy link
Contributor

oskosk commented Nov 29, 2021

Tried to review this PR by launching two JN sites... I had the following issue both times so could't continue testing.

  • First, from the testing steps, I didn't get the "Thank you for purchasing [product-name]!" page but continued with the next testing step.
  • Then, I wasn't able to validate the license. Both times I got Unable to validate license.
    image

One observation about the sent email

In the license form we specify that we send an email with the license. For the first site I didn't get such email.. I did get one other email about the goodies of the Complete plan...
For the second site, I did get the mail message with the license.

image

@rcanepa
Copy link
Contributor Author

rcanepa commented Nov 29, 2021

Tried to review this PR by launching two JN sites... I had the following issue both times so could't continue testing.

It will be hard to test these changes with a JN site due to the reason explained in the PR's description (TL;DR: the request for activating Jetpack Complete times out). If you test it locally, you can hardcode a bigger timeout (say, to 20 seconds) and make it work. Another option is to apply D70690-code to your sandbox and make your JN site rely on it. That small patch should make the activation go faster.

  • First, from the testing steps, I didn't get the "Thank you for purchasing [product-name]!" page but continued with the next testing step.

Good catch. I fixed the instruction.

  • Then, I wasn't able to validate the license. Both times I got Unable to validate license.

This is the result of the request failing due to the timeout.

One observation about the sent email

In the license form we specify that we send an email with the license. For the first site I didn't get such email.. I did get one other email about the goodies of the Complete plan... For the second site, I did get the mail message with the license.

Thanks for pointing this out. We will take care of investigating this issue.

@oskosk oskosk added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from Crew. Label will be renamed soon. labels Nov 29, 2021
@samiff samiff enabled auto-merge (squash) November 29, 2021 19:09
@samiff samiff self-requested a review November 29, 2021 19:12
@samiff samiff merged commit 851be38 into master Nov 29, 2021
@samiff samiff deleted the add/fetch-settings-modules-after-license-activation branch November 29, 2021 19:29
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 29, 2021
davidlonjon added a commit that referenced this pull request Dec 2, 2021
* master: (22 commits)
  Update storybook monorepo to v6.4.0 (#21897)
  Refresh the site's modules and settings after successful product activation (#21886)
  Plugin Install: Bump MC stat on success or fail. (#21893)
  Nav Unification: Use correct user capability for the Inbox menu item (#21882)
  Jetpack: Extend disconnection dialog component to handle multiple steps and accept more props (#21048)
  Disable CSSTidy property shorthand optimization in the editor or headstart (#21891)
  Connection UI: Update Composer instructions in README.md (#21890)
  Partner Compatibility: Adding a unique connection screen for customers who receive a coupon from a Jetpack partner (#21813)
  Search package: move search dashboard to package - the base (#21865)
  JITM: wrap CTA below text on small viewports (#21688)
  Licensing JS Package – fix icon positioning and width (#21878)
  JITM: new JS and CSS builder (#21874)
  Support site_intent for `/me/sites` endpoint (#21880)
  Don't render Critical CSS while generating CritCSS. (#21879)
  ConnectScreen: make button full width on small screens (#21683)
  Improve the copy of the license activation banner (#21876)
  Rename Webpack-built files back from `.min.js` and remove hashes (#21748)
  Search: Migrate more helper classes to package (#21751)
  Search: migrate/add search rest API (#21584)
  Add initial state to the connection package (#21864)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin Page React-powered dashboard under the Jetpack menu [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants