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

Stepper: Reset new-hosted-site-flow store when mounting the flow #101732

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

epeicher
Copy link
Contributor

@epeicher epeicher commented Mar 21, 2025

Related to DOTOBRD-12-linear-issue

Proposed Changes

  • Refines the condition to reset the OnboardStore when mounting the new-hosted-site-flow

Why are these changes being made?

  • To fix an issue with sharing the state when having multiple tabs open at the same time
  • The partnerBundle piece of state was being read from the new tab when it should not be there for a new flow

Testing Instructions

  • Apply these changes and run Calypso locally
  • Navigate to the PTO flow /setup/new-hosted-site/plans?partnerBundle=square
  • Check the partnerBundle is in the state by running window.wp.data.select('automattic/onboard').getPartnerBundle() in the Developer Console
  • Without closing the tab, open another tab and navigate to the flow without the partnerBundle, i.e. /setup/new-hosted-site (please note that /plans should not be added).
  • Check the partnerBundle is not in the state by running window.wp.data.select('automattic/onboard').getPartnerBundle() in the Developer Console
  • Complete the flow to create a site without the partnerBundle
  • Check the WooCommerce plugin is not installed
  • Complete the flow in the tab with the partnerBundle
  • Check the system navigates to WooCommerce Launchpad and Get paid with Square is displayed

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

@matticbot
Copy link
Contributor

This PR does not affect the size of JS and CSS bundles shipped to the user's browser.

Generated by performance advisor bot at iscalypsofastyet.com.

Copy link
Contributor

@gavande1 gavande1 left a comment

Choose a reason for hiding this comment

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

LGTM !

@epeicher epeicher merged commit b48ad76 into trunk Mar 24, 2025
15 checks passed
@epeicher epeicher deleted the fix/reset-store-for-new-hosting-flow branch March 24, 2025 09:20
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.

3 participants