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 the occasional flow loop from the dotlink version of Link in Bio flow. #71117

Closed

Conversation

southp
Copy link
Contributor

@southp southp commented Dec 13, 2022

Proposed Changes

This PR is a simpler, anecdotal fix for the flow loop reported in p2-pdtkmj-Sc#comment-1393 experienced by @jordesign and @semihakocer.

The reason that sometimes the dotlink version of Link in Bio flow can stuck like this is because Calypso intentionally persists state on a periodical fashion instead of on every change. When transiting from /start/domain to /setup/pattern, if the domain step submission isn’t persisted, then the user will be redirected back to the domains step upon arrival of /start/plans latter, since the signup framework will consider the previous required step, i.e. the domains step, isn’t completed.

This PR addresses the issue by only performing the middle trainstion from /start/link-in-bio-tld to /setup/link-in-bio when all the steps before that transition has been successfully completed. I'm saying it's an "anecdotal" fix, because theoretically speaking I think this can still happen; just that by confirming that all the states has been updated to completion before navigating away makes it harder to happen. A stronger guarantee would be polling the IDB, but the cost of doing so would outweigh the benefit.

Testing Instructions

Going through /start/link-in-bio-tld?tld=link flow for multiple times. You can start by signing up a new account and then typing out the URL everytime you reach the launchpad. In production, I could reproduce the bug by doing in about 5~6 times. Once it is reproduced, trying out the whole flow many more times on the calypso.live instance of this PR to see if it's not reproducible.

From my testing, this bug can be reproduced locally, but somehow it's a lot harder. Using the calypso.live instance in this PR would be easier.

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 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-ajp-p2)?

Related to #

@southp southp self-assigned this Dec 13, 2022
@github-actions
Copy link

github-actions bot commented Dec 13, 2022

@southp southp changed the title A quick PoC of the attempt solution. Fix the occasional flow loop from the dotlink version of Link in Bio flow. Dec 13, 2022
@southp southp added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Dec 13, 2022
@southp southp marked this pull request as ready for review December 13, 2022 08:58
@southp southp added [Status] In Progress and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Dec 13, 2022
@southp
Copy link
Contributor Author

southp commented Dec 13, 2022

Oops. I've reproduced the bug after updating the PR description, so it's not even mitigating :(

@southp
Copy link
Contributor Author

southp commented Dec 19, 2022

Closing this in favor of #71204

@matticbot
Copy link
Contributor

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

Sections (~123 bytes added 📈 [gzipped])

name              parsed_size           gzip_size
signup                 +370 B  (+0.1%)     +123 B  (+0.2%)
videopress-flow        +174 B  (+0.0%)      +65 B  (+0.1%)
newsletter-flow        +174 B  (+0.0%)      +65 B  (+0.1%)
link-in-bio-flow       +174 B  (+0.0%)      +65 B  (+0.0%)
jetpack-connect        +174 B  (+0.0%)      +65 B  (+0.0%)
free-flow              +174 B  (+0.0%)      +65 B  (+0.0%)
accept-invite          +174 B  (+0.0%)      +65 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.

@sirreal sirreal deleted the fix/anecdotal-fix-for-link-in-bio-tld-looping-bug branch January 14, 2025 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants