-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Milestone
Description
Current behavior
- Open a new incognito window (must have completely clean state!)
- Add a product to the cart
- Expectation is that addToCart method in the the
AddToCart.vuecomponent receives thediffLogproduced by the request - However the entries in the received
diffLogare empty:items: Array(0) length: 0 serverResponses: Array(0) length: 0 clientNotifications: Array(0) length: 0 - On the following calls the
diffLoghas the correct data.
Expected behavior
The diffLog should contain the details, i.e:
items: Array(3)
0: {party: "server", sku: "866550", status: "no-item"}
1: {party: "client", status: "no-changes"}
2: {party: "server", status: "no-changes"}
length: 3
serverResponses: Array(1)
0: {status: 200, sku: "866550", result: {…}}
length: 1
clientNotifications: Array(0)
length: 0
I think the problem happens because on the very first time the sync happens through the create action instead of the sync action
However, the create call does not return any diffLog. I believe the fix would be to return the result here: https://github.com/DivanteLtd/vue-storefront/blob/v1.11.2/core/modules/cart/store/actions/connectActions.ts#L72
And then process that result (use diffLog.merge()?) in order to return the correct data to the AddToCart component.
I do not fully understand how all the cart related features work together, so could someone confirm whether my suggestion makes sense?
Can you handle fixing this bug by yourself?
- YES
- NO
Which Release Cycle state this refers to? Info for developer.
Pick one option.
- This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from
developbranch and create Pull Request2. Feature / Improvementback todevelop. - This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.