Decorating the UserCartRecalculationListener#682
Conversation
|
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.* |
There was a problem hiding this comment.
Thank you, Jakob.
@mamazu @lchrusciel guys, if you agree with the approach, let's not marinate this issue for months :)
| use Sylius\Component\Order\Context\CartContextInterface; | ||
| use Sylius\Component\Order\Context\CartNotFoundException; | ||
| use Sylius\Component\Order\Processor\OrderProcessorInterface; | ||
| use Symfony\Contracts\EventDispatcher\Event; |
There was a problem hiding this comment.
| use Symfony\Contracts\EventDispatcher\Event; | |
| use Symfony\Component\EventDispatcher\Event; |
Or we should probably add contracts to composer
There was a problem hiding this comment.
Oh, now I see it... #682 (comment) What would you say for using JWT class explicitly?
Also, can we maybe make it explicit, that we are removing service from the container (for example in CompilerPass with link to issue on Github) and declare separate service? Or at least link in the comment that is right now, to current issues on Github?
c20024a to
1816a3e
Compare
1816a3e to
84367c7
Compare
|
Thanks, Jakob! 🥇 |
With this the
UserCartRecalculationListenerlistens tolexik_jwt_authentication.on_jwt_createdinstead ofsecurity.interactive_login, recalculating the cart only on an actual login.Fixes: #667 #681