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

Post-checkout redirect sometimes gets stuck in site fetching loop #69833

Closed
sirbrillig opened this issue Nov 7, 2022 · 3 comments · Fixed by #69837
Closed

Post-checkout redirect sometimes gets stuck in site fetching loop #69833

sirbrillig opened this issue Nov 7, 2022 · 3 comments · Fixed by #69837
Assignees

Comments

@sirbrillig
Copy link
Member

sirbrillig commented Nov 7, 2022

See report here: #69769 (review)

200374030-314db659-2dbb-476b-9255-19f03d52be92

Also reported here: https://github.com/Automattic/payments-shilling/issues/1217#issuecomment-1301169773

This appears to happen (at least) when using a checkout URL like /checkout/personal-bundle,dotlive_domain/gift/<PLAN_SUB_ID>,<DOMAIN_SUB_ID> (a purchase of a plan and a domain for someone else's site).

@sirbrillig sirbrillig self-assigned this Nov 7, 2022
@sirbrillig
Copy link
Member Author

sirbrillig commented Nov 7, 2022

Ok, so this case (the "Almost done…" notice) only shows up for siteless checkout (or this condition which I'm pretty sure is always false since isDomainOnly requires a site and that condition requires no site).

If that happens, rather than redirecting, and there's a domain in the cart, checkout will repeatedly fetch the sites data until the site is included. Because a gift purchase doesn't actually create a new site, the polling goes on forever.

This makes me think that these transactions have create_new_blog set when they probably should not (or I'm wrong about the isDomainOnly condition never happening).

@sirbrillig
Copy link
Member Author

sirbrillig commented Nov 7, 2022

create_new_blog is probably being set to true by this code when there is no siteId. We should change that so that it is false for gift purchases.

Currently it is set by the existence of siteId which comes from the payment processor data which is set here (note the secondary case for Jetpack siteless checkout where it is set to the cart's blog_id instead) and comes originally from the getSelectedSiteId Redux selector. Since gift purchases explicitly set the selected site to null, then the site ID is always undefined, causing create_new_blog to be true.

@sirbrillig
Copy link
Member Author

Looks like create_new_blog doesn't seem to do anything during a transaction anyway, so we can probably start to remove that property entirely. In the meantime, I think we can remove the polling that is causing this bug.

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 a pull request may close this issue.

1 participant