Fix the occasional flow loop from the dotlink version of Link in Bio flow. #71117
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Related to #