Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 198 forks source link

Receiving incorrect data from cartLinesAdd and cartLinesRemove mutations #1243

Open AndriyLitvinyuk opened 2 months ago

AndriyLitvinyuk commented 2 months ago

If we are using cartLinesRemove mutation, we are receiving the correct empty cart from the response, but if after that in quick succession there will be used cartLinesAdd on the same item, the endpoint returns the old cart item + new quantity Had 1 item with a quantity of 3. Response from remove mutation:

 Result <Mutation: ["cartLinesRemove": {
    cart =     {
        lines =         {
            nodes =             (
            );
        };
    };
}]>

Right after that response from add mutation with the same item with quantity of 3.

Result <Mutation: ["cartLinesAdd": {
    cart =     {
        lines =         {
            nodes =             (
                                {
                    "__typename" = CartLine;
                    id = "****";
                    merchandise =                     {
                        "__typename" = ProductVariant;
                        id = "****";
                    };
                    quantity = 6;
                }
            );
        };
    };
}]>

I tried disabling the cache for the client and URLSession, and it's not helping at all. CartId is the same, updatedAt in the responses is correct as well.