-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Storage Add-On: Fix spotlight plan CTA upgrade behavior #84289
Conversation
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Sections (~10 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. Async-loaded Components (~10 bytes added 📈 [gzipped])
React components that are loaded lazily, when a certain part of UI is displayed for the first time. 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. |
const nonDefaultStorageOptionSelected = defaultStorageOption !== selectedStorageOptionForPlan; | ||
const nonDefaultStorageOptionSelected = | ||
selectedStorageOptionForPlan !== undefined || | ||
selectedStorageOptionForPlan !== defaultStorageOption; |
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.
I'm also having trouble reproducing the original issue. However, shouldn't this be selectedStorageOptionForPlan !== undefined && selectedStorageOptionForPlan !== defaultStorageOption
; ? Currently it reads like as long as a storage option is picked and then nonDefaultStorageOptionSelected
will be true, which doesn't sound like what we intend 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.
Ah you're absolutely right.
I drafted this PR relatively quickly during the tail end of the dotcom meetup, but I'll take a moment, re-review the changes, and make sure things make more sense. Thanks for pointing this out @southp 👍
@jeyip which issue are you not able to reproduce? Not sure if I'm doing something wrong, but
Screen.Recording.2023-11-24.at.11.50.48.AM.movand if I purchase the 100GB upgrade on the same site & plan, this is how it behaves now: Screen.Recording.2023-11-24.at.11.52.04.AM.mov |
Thanks for the testing instructions 🙏 I was unable to replicate case 1 and case 2 on Reading things back, I noticed that you were using the live image. I also see that you're testing with a fresh site. Lemme try again with the steps you outlined Edit:
|
9ea177f
to
b140e41
Compare
@chriskmnds still unable to reproduce, but I'll keep testing different conditions and other ways that my testing environment is might be different than yours. While I'm doing this, would you be able to do me a favor and log out the following code in L262 of
wp-calypso/client/my-sites/plans-grid/components/actions.tsx Lines 254 to 262 in 74f4d92
After reviewing your GIFs, it seems like the only way we'd see the unexpected behavior is if |
I've spent some time investigating this today. Even though I didn't get anything concrete yet, I noticed that the state of selected storage add-on option is not restrained within the selected site. i.e. if I select 100G for the Business plan on my site A, then I'll see 100G is selected when I acceess /plans on my site B or in whereever the pricing grid is shown. This might not directly relate to this, but I have a gut feeling that it's a risky behavior. I'll see if I can find something more next week if no one beat me to it. |
Indeed. I have a similar suspicion. I haven't got around to testing but will try and get to it in a bit |
@jeyip this is what is being logged when I reach the following state in the UI: ![]() ![]() I believe I can reproduce the above consistently right now, with the following steps:
The following happens when visiting Screen.Recording.2023-12-08.at.2.33.52.PM.movand this is what happens when I reload the page after that point (with the same console logger) - it switches from "manage plan" to "upgrade" (the wrong state): Screen.Recording.2023-12-08.at.2.38.34.PM.movI am not sure if it's related to what @southp mentioned above. That part seems critical too, although I wonder if it would be as pervasive given we don't persist the respective data-store property to local storage (so it might only occur when switching sites within page session, I think?) |
Ahhh this makes a lot of sense. I'll see if I can't explore this further 🤔 Thanks for the thoughts @southp + @chriskmnds! |
It's toward the end of my day, but I'm returning to this now. Hopefully will have things pinpointed some time tomorrow 🕵️ |
Pausing focus on this for the time being to help shepherd the dropdown term selector experiment https://github.com/Automattic/growth-foundations/issues/296 |
Did a cursory review and this PR seems irrelevant now. I'll close it for the time being and we can reopen if we understand things otherwise. |
Related to https://github.com/Automattic/martech/issues/2418
Proposed Changes
Testing Instructions
I spent quite a bit of time attempting to replicate the original bug ( different browsers, throttled connections, mobile vs. desktop etc. ). I wasn't able to successfully reproduce it which means that I can't 100% confirm that the issue is fixed. Given the reported behavior though, I do believe that the problem should be addressed with this PR.
With that in mind, we can still smoke test intended behavior to ensure that storage add-on dropdown functionality is still correct.
/start/plans
/plans
Pre-merge Checklist