Sylius / ShopApiPlugin

Shop API for Sylius.
https://sylius.com
130 stars 89 forks source link

Decorating the UserCartRecalculationListener #682

Closed JakobTolkemit closed 3 years ago

JakobTolkemit commented 3 years ago

With this the UserCartRecalculationListener listens to lexik_jwt_authentication.on_jwt_created instead of security.interactive_login, recalculating the cart only on an actual login.

Fixes: https://github.com/Sylius/ShopApiPlugin/issues/667 https://github.com/Sylius/ShopApiPlugin/issues/681

diimpp commented 3 years ago

This doesn't solve #667, which prime reason are concurrent frontend calls, not internal over-use of order processing.

As for #681, personally I consider it undesirable side effect and that stateless shop-api shouldn't offer this functionality at all, moreover if a proper stateless cart context would be implemented, then this feature will never be called.

Though for the sake of a bit less broken shop-api plugin it can be done this way for 1.*

mamazu commented 3 years ago

Thanks, Jakob! :1st_place_medal: