-
Notifications
You must be signed in to change notification settings - Fork 2k
Add queryParam to invalid cache when navigating away from site setup flow #72930
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
Add queryParam to invalid cache when navigating away from site setup flow #72930
Conversation
Paired with @agrullon95 on this so +1 from me |
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~67 bytes added 📈 [gzipped])
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. Generated by performance advisor bot at iscalypsofastyet.com. |
if ( maybeStalelaunchpadScreenOption && maybeStalelaunchpadScreenOption === 'full' ) { | ||
if ( | ||
( maybeStalelaunchpadScreenOption && maybeStalelaunchpadScreenOption === 'full' ) || | ||
currentUrl?.includes( 'postOnboarding=true' ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we get and read the query args specifically here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
side note, if we are only adding the arg from launchpad flows, then we could maybe just use that itself as the indication to redirect back to the launchpad here as opposed to refetching? Although, maybe the refetching is good to do in the first place anyways to make sure calypso store is truly up to date.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we get and read the query args specifically here?
Could you elaborate on this?
if we are only adding the arg from launchpad flows, then we could maybe just use that itself as the indication to redirect back to the launchpad here as opposed to refetching?
If we don't force a refetch, even if we redirect to Launchpad, the site option data in redux still might be stale if they happen to navigate to my home. I believe, however, if the user visits /view
or the post or site editor ( the only pages the user can navigate to from the Launchpad ), the cache should be invalidated and things should behave as expected, but I'm not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you elaborate on this?
Sure, its probably not a big deal at all but right now we are just parsing the entire string of the URL to see if "postOnboarding=true" is part of the string. As opposed to getting the specific params out of the URL and checking their values. This might generally be something like $_GET in php or maybe searchParams in JS (maybe theres another method im not remembering). That said, Its probably not a big deal. We aren't going to see postOnboarding=true
elsewhere in the URL string so it should work the same way.
If we don't force a refetch, even if we redirect to Launchpad, the site option data in redux still might be stale if they happen to navigate to my home. I believe if we visit /view or the editors the cache should be invalidated, but I'm not sure
That makes sense 👍
Testing
|
Testing/Review:
Test: short
Review: short
Proposed Changes
Write
orBuild
), the user may be navigated to the home screen instead of the launchpad screen. These changes add thepostOnboarding=true
query parameter to site setup exit flow redirection URL, invalids the site data and fetches it again.Testing Instructions
yarn start
write
site intentpostOnboarding=true
query param in the /home url before being redirected to Launchpadwp-calypso/client/my-sites/customer-home/controller.jsx
Lines 55 to 62 in 70ac415
Pre-merge Checklist
Related to #72872