-
Notifications
You must be signed in to change notification settings - Fork 615
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
Revert "Reset cart quantity to 0 if we get a 404 for the cart" #1920
base: master
Are you sure you want to change the base?
Conversation
This reverts commit caa1b30. This will now be handled upstream in stencil-utils as a 404 is not an err from fetch JakeChampion/fetch#155
Autotagging @bigcommerce/themes-team |
cc @jairo-bc @bookernath as you were both involved in the linked PRs. would appreciate you taking a look at this :) |
@rowleyaj LGTM. I think you can bump stencil-utils version in this PR. I will handle releasing stencil-utils. |
@jairo-bc thanks! i've added the package.json change for that, however I won't be able to update the lock file until I can do an NPM install with the real package |
Is this related? On multiple themes, the scripts responsible for fetching cart metadata It's called in The problem is - the CartID is occasionally stale if you've previously used This means that the call to stencil-utils |
@Mikhail-MM yup that's the same issue I was having. After falling down the 🐰 🕳️ an digging through the code this is where i ended up. Essentially it's fixed in stencil-utils once we import the newer version to cornerstone, this PR is just cleaning up after that fix. |
@rowleyaj stencil-utils 6.7.0. was released. Now you can update your PR |
@jairo-bc sorry for the delay - PR updated with 6.7.0 in the lockfile now and CI is green |
@jairo-bc @BC-tymurbiedukhin @bookernath happy new year - just checking in on this one to see if we can get it merged 🤞 |
@jairo-bc @BC-tymurbiedukhin @bookernath fixed the conflict. a higher version of stencil-utils has been included now so the main issue should be resolved. i think this should still be merged though as it cleans up code that isn't needed anymore. |
@jairo-bc @BC-tymurbiedukhin @bookernath anything else needed on this before it can be merged? |
@rowleyaj Could you please add changelod item as well? |
@BC-tymurbiedukhin this has been added to the changelog now. would you accept a PR to add this requirement to the pull request template and contributing guide? i've created 2080 for this it seems that this PR was held up for quite a long time just because of this small missing piece |
@BC-tymurbiedukhin any updates on this one? |
What?
This reverts commit caa1b30.
I noticed issues on my site where the cart quantity was not updating correctly. I dug into this and found that this is likely due to the 404 for the cart page no longer being handled correctly after the move from jquery to fetch.
fetch does not handle 404 as an error and requires this to be handled by consumer code. this looks to have been added in stencil utils bigcommerce/stencil-utils#137 as part of STRF-8771 so this code in cornerstone is no longer required. the stencil-utils change should fix the type error that occurs when trying to read physicalItems of a non-existent cart. this is the error that was making it's way through to this code which is why I noticed the 404 no longer makes it through to here.
This PR has pre-requisites:
I'm unsure of the release process for the other libs so wasn't sure if making a PR to bump the package.json was useful or not.
Hope this helps. I'd really appreciate if we can get this into a cornerstone release soon so that our cart quantity works again!
Tickets / Documentation
Add links to any relevant tickets and documentation.