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

Fix how the TLD list is loaded and checked in the gravatar flow #96641

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

hambai
Copy link
Contributor

@hambai hambai commented Nov 21, 2024

The way we check the TLDs in the registration flow for Gravatar domains was assuming that the available TLDs list is already loaded. However the coded didn't work like that and if you go to the flow with a new query param that contains an FQDN it would show you "The domain extension you are looking for is currently not supported. Additional domain extensions may become available for a fee in the future." error message even though the TLD is a supported one.

Screenshot 2024-11-21 at 19 44 23 Here's how it looks

Proposed Changes

  • add callback parameter to the getAvailableTlds method so that we can call the checkDomainAvailability after the TLDs were loaded and set in the state
  • in checkDomainAvailability method always clear the error message if in the gravatar flow

Why are these changes being made?

  • Otherwise a bug shows up where you go to the gravatar flow with a valid domain but you get an error

Testing Instructions

  • go to /start/domain-for-gravatar/domain-only?search=yes&new=test20241121.link and verify that you won't get the error
  • the go to /start/domain-for-gravatar/domain-only?search=yes&new=test20241121.net and verify that you see the error
  • then go again to /start/domain-for-gravatar/domain-only?search=yes&new=test20241121.link and verify that you won't get the error

Unfortunately because of how the signup works the message is shown quckly if the previous search had it. This is how the signup works. Fixing that would require a bigger refactoring and I'm not even sure where to start.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
    • For UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-aUh-p2)?

@hambai hambai added the [Type] Bug When a feature is broken and / or not performing as intended label Nov 21, 2024
@hambai hambai self-assigned this Nov 21, 2024
@hambai hambai requested a review from a team as a code owner November 21, 2024 17:45
@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 Nov 21, 2024
@matticbot
Copy link
Contributor

matticbot commented Nov 21, 2024

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

Sections (~121 bytes added 📈 [gzipped])

name                  parsed_size           gzip_size
update-design-flow         +372 B  (+0.0%)     +121 B  (+0.0%)
link-in-bio-tld-flow       +372 B  (+0.0%)     +121 B  (+0.0%)
domains                    +372 B  (+0.0%)     +121 B  (+0.0%)
copy-site-flow             +372 B  (+0.1%)     +121 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.

Async-loaded Components (~121 bytes added 📈 [gzipped])

name                             parsed_size           gzip_size
async-load-signup-steps-domains       +372 B  (+0.1%)     +121 B  (+0.1%)

React components that are loaded lazily, when a certain part of UI is displayed for the first time.

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

@leonardost leonardost left a comment

Choose a reason for hiding this comment

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

I've tested this and works great, thanks for this fix!

As we discussed today, maybe we could hardcode the TLDs instead of making a call to get them. It's another place to update when we add new TLDs, but I think the user experience will be better since we save one network call.

@hambai hambai merged commit 02e202d into trunk Nov 25, 2024
11 checks passed
@hambai hambai deleted the fix/tld-check-for-gravatar-flow branch November 25, 2024 13:52
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants