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

[PWA-480] Price summary does not get updated after removing an item. #2329

Merged
merged 2 commits into from
Apr 14, 2020

Conversation

tjwiebell
Copy link
Contributor

Description

URL - https://develop.pwa-venia.com/

Steps -

  1. Add 2 products to cart and go to /cart page
  2. Remove one product from cart page

Expected - Price summary should get updated for remaining products.
Actual - Price summary is blank, only labels no values.

Related Issue

  • [PWA-480] Price summary does not get updated after removing an item.

Acceptance

Verification Stakeholders

Specification

Verification Steps

  1. Go through repro steps in description, verify bug no longer present
  2. Step through other price adjustment panels that affects cart updating state (totals go away while mutations are in flight), verify they still work.

Screenshots / Screen Captures (if appropriate)

Checklist

  • I have updated the documentation accordingly, if necessary.
  • I have added tests to cover my changes, if necessary.

@PWAStudioBot
Copy link
Contributor

PWAStudioBot commented Apr 13, 2020

Messages
📖

Access a deployed version of this PR here. Make sure to wait for the "pwa-pull-request-deploy" job to complete.

📖 DangerCI Failures related to missing labels/description/linked issues/etc will persist until the next push or next nightly build run (assuming they are fixed).
📖

Associated JIRA tickets: PWA-480.

Generated by 🚫 dangerJS against 9e4a1d6

@@ -32,6 +32,9 @@ export const useProduct = props => {
// If a product mutation is in flight, tell the cart.
setIsCartUpdating(updateItemLoading || removeItemLoading);
}

// Reset updating state on unmount
return () => setIsCartUpdating(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the onCompleted callback instead?

https://www.apollographql.com/docs/react/data/mutations/#options

@m2-community-project m2-community-project bot moved this from Ready for Review to Review in Progress in Pull Request Progress Apr 13, 2020
Copy link
Contributor

@sirugh sirugh left a comment

Choose a reason for hiding this comment

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

Hah whoops. We should get better about adding cleanups on unmount! Nice catch.

I had a question about using something a bit more explicit but I'm not even sure that'll work. I approve of this method.

@sirugh sirugh added the version: Patch This changeset includes backwards compatible bug fixes. label Apr 14, 2020
@dpatil-magento dpatil-magento merged commit 2f6567c into develop Apr 14, 2020
@dpatil-magento dpatil-magento deleted the bug/pwa-480 branch April 14, 2020 19:37
@m2-community-project m2-community-project bot moved this from Review in Progress to Done in Pull Request Progress Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:peregrine version: Patch This changeset includes backwards compatible bug fixes.
Development

Successfully merging this pull request may close these issues.

None yet

4 participants