vuestorefront / vue-storefront

Alokai is a Frontend as a Service solution that simplifies composable commerce. It connects all the technologies needed to build and deploy fast & scalable ecommerce frontends. It guides merchants to deliver exceptional customer experiences quickly and easily.
https://www.alokai.com
MIT License
10.64k stars 2.08k forks source link

Remake order functionality non-deterministic behavior #2964

Closed Zanuff closed 5 years ago

Zanuff commented 5 years ago

Current behavior

Remake order functionality ends up with random number of products in cart if not locked on backend side. Probably due to the asynchronicity of the requests.

Expected behavior

Remake order functionality should end up with the same number of products in cart after clicking remake order.

Steps to reproduce the issue

  1. Have an account with orders
  2. Have an order with multiple products added
  3. Go to my orders and click remake order
  4. See how the cart id updated several times and end up with different number of tiems and totals

Can you handle fixing this bug by yourself?

Which Release Cycle state this refers to? Info for developer.

Pick one option.

alinadivante commented 5 years ago

Something is wrong when I try remake really big order (94 items).. Look at minicart-counter big_order

pkarw commented 5 years ago

Ok, it’s on the branch 2513 right?

alinadivante commented 5 years ago

Yes @pkarw - feature/2513

pkarw commented 5 years ago

OK, I've refactored it a little bit https://github.com/DivanteLtd/vue-storefront/pull/2887

alinadivante commented 5 years ago

Nice job!

alinadivante commented 5 years ago

@pkarw I tested it again, after merging, but now I see a problem with a duplicate notification and it takes a while before the user is redirected to the checkout. See my new video. big_order

Imho there should be loader displayed or information about the processing.

pkarw commented 5 years ago

OK, we need to add the check for duplicated notification in the core/modules/cart/store/actions.ts:583

pkarw commented 5 years ago

I've also got a console error: vuex.esm.js:410 [vuex] unknown action type: cart/getPaymentMethods

pkarw commented 5 years ago

Check also the forceServerSync when entering Checkout.js. Currently it is set with the remake order - and probable shouldn't be (it will save us on cart sync)

pkarw commented 5 years ago

Plus as @alinadivante wrote - adding a popup / blocking loader