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

Domains: Display a notice when redirecting away from Google Workspace upgrade #50738

Merged
merged 2 commits into from
Mar 8, 2021

Conversation

sirbrillig
Copy link
Member

@sirbrillig sirbrillig commented Mar 3, 2021

Changes proposed in this Pull Request

The Google Workspace upgrade page that's usually displayed between selecting a new domain and reaching checkout has a failsafe mechanism which will redirect back to the domains page if the cart does not contain a domain product. I believe that this might sometimes be triggered incorrectly (see the failing e2e test in #50723), but it's hard to know because the redirect is so fast and there's no context given to the user.

This PR adds a notice when the redirect occurs so that there's at least a reason given for ending up on a different page.

Before:

Screen Shot 2021-03-03 at 5 28 38 PM

After:

Screen Shot 2021-03-03 at 5 28 27 PM

Testing instructions

  • Make sure your cart is empty.
  • Visit the Google Workspace upgrade page directly at a URL like /domains/add/google.com/google-apps/example.com (the first domain name is the domain you're supposedly adding so it can be anything; the second domain name is your wp.com site).
  • Verify that after the page loads you are redirected to the "Site Domains" page which lets you search for a domain.
  • Verify that you see a notice message mentioning that there is no domain in your cart.

@matticbot
Copy link
Contributor

@sirbrillig sirbrillig self-assigned this Mar 3, 2021
@sirbrillig sirbrillig marked this pull request as ready for review March 3, 2021 22:29
@sirbrillig sirbrillig requested a review from a team as a code owner March 3, 2021 22:29
@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 Mar 3, 2021
@sirbrillig sirbrillig added [Feature] Checkout The checkout screen and process for purchases made on WordPress.com. [Feature Group] Emails & Domains Features related to email integrations and domain management. labels Mar 3, 2021
@sirbrillig sirbrillig requested a review from a team March 3, 2021 22:29
@matticbot
Copy link
Contributor

matticbot commented Mar 3, 2021

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

Sections (~96 bytes added 📈 [gzipped])

name     parsed_size           gzip_size
domains       +240 B  (+0.0%)      +96 B  (+0.0%)

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

@nbloomf nbloomf left a comment

Choose a reason for hiding this comment

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

I see a couple of issues, one probably less important than the other.

Less important: If I put a domain in the cart and then manually load the Workspace upgrade url using a different domain, the error message says "there is no domain in your cart" when this is not actually true. On the off chance that a user could see this message, maybe it could instead say something like "To add an email product for example.com, you must either already own it or have it in your shopping cart."

More important: Cobalt can verify this, and it appears to predate this PR, but I think the redirect logic may be too aggressive. This redirects if the domain is not in the cart, but I think email should still be purchasable if I already own the domain (and thus may not have it in the cart). E.g. the following ends in a confusing redirect:

  1. Complete purchase for domain example.com
  2. Manually load /domains/add/example.com/google-apps/mywpsubdomain.wordpress.com
  3. Get redirected to domain search page with an error message.

@sirbrillig
Copy link
Member Author

Less important: If I put a domain in the cart and then manually load the Workspace upgrade url using a different domain, the error message says "there is no domain in your cart" when this is not actually true. On the off chance that a user could see this message, maybe it could instead say something like "To add an email product for example.com, you must either already own it or have it in your shopping cart."

Good point. I've updated the text.

This redirects if the domain is not in the cart, but I think email should still be purchasable if I already own the domain (and thus may not have it in the cart)

I think this is handled by a different flow. This flow is AFAIK only used when coming from the "add domain" page (which means that in theory this error should never happen but the guard implies that it may).

@nbloomf nbloomf 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 Mar 8, 2021
@sirbrillig
Copy link
Member Author

I think this is handled by a different flow. This flow is AFAIK only used when coming from the "add domain" page (which means that in theory this error should never happen but the guard implies that it may).

Also, even if this did happen, it's probably better to have an error message than to have no message.

@sirbrillig sirbrillig merged commit 1d734da into trunk Mar 8, 2021
@sirbrillig sirbrillig deleted the add/notice-to-gsuite-upgrade-redirect branch March 8, 2021 21:00
@a8ci18n
Copy link

a8ci18n commented Mar 8, 2021

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/5568006

Thank you @sirbrillig for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Mar 18, 2021

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Estimate] 1 [Feature] Checkout The checkout screen and process for purchases made on WordPress.com. [Feature Group] Emails & Domains Features related to email integrations and domain management.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants