Reaction: addToCart mutation incorrect subtotal calculation

Created on 14 Feb 2019  路  7Comments  路  Source: reactioncommerce/reaction

Prerequisites

  • [x] Are you running the latest version?
  • [x] Are you able to consistently reproduce the issue?
  • [x] Did you search the issue queue for an existing issue? Search issues

Issue Description

Hi! I'm using Reaction Commerce Graphql API in my project. After updating to the latest version, I've found an issue in addToCart mutation.

The issue is in subtotal calculations here. It doesn't affect on the Reaction Commerce dashboard because it calculates with getSubtotal method. But it stores incorrect data and affects my client application.

Steps to Reproduce

Just add an item to a cart

screen shot 2019-02-14 at 5 02 42 pm

Possible Solution

It should be calculated a new quantity value before subtotal calculating (quantity updates here)

Versions

Node: 8.15.0
NPM: 6.4.1
Meteor Node: 8.11.4
Meteor NPM: 6.4.1
Reaction CLI: 0.29.0
Reaction: 2.0.0-rc.9
Reaction branch: master
Docker: 18.09.1

bug

All 7 comments

@jeffcorpuz can you take a look at this?

Hi @vadym-vorobel thanks for the report, will start investigating.

@spencern

I can confirm that reported behavior is occurring on the latest through:

  • Incrementing the same item X at a time.

Seems the sub-total's initial amount does not get updated per modification of quantity.

Starting Quantity = 2, Price at $19.99


screen shot 2019-02-14 at 12 39 40 pm

Added +2


screen shot 2019-02-14 at 12 40 21 pm

Assigning @kieckhafer to look at it

@kieckhafer @jeffcorpuz Does this impact the amount charged when an order is created? This may need to be escalated to an impact-critical if so.

@kieckhafer @spencern
This does not impact the amount charged when an order is created.
The true subtotal exists in the checkout process.

@vadym-vorobel @spencern I might have fixed the same issue via another ticket.... does this look like it's the same to you?

https://github.com/reactioncommerce/reaction-next-starterkit/issues/462

and the PR:

https://github.com/reactioncommerce/reaction/pull/5021

@vadym-vorobel I believe this was closed via https://github.com/reactioncommerce/reaction/pull/5021, feel free to re-open if that's not the case.

@kieckhafer yep, it seems the same. Thanks!

Was this page helpful?
0 / 5 - 0 ratings