You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This happens due the fact that ShopApiPlugin doesn't define CartContext and Core\CartContext considers last assigned cart as current cart, which is not true for shop-api. It also expected be triggered only at login in html website, but in shop-api it happens in each request with JWT token.
This results in metric ton of deadlocks for any authorized user and renders SPA app unusable.
Solution is to override listener and disable it.
The text was updated successfully, but these errors were encountered:
I don't think we should additionally recalculate cart in every request at cart or checkout as most of those endpoints already doing their own order processing.
Original sylius strategy doesn't quite fit shop-api stateless state and any new strategies will heavily depend on how frontend will use api endpoints. (For example new /carts/{token}/refresh, which can be called on login by frontend)
So I think best course of action is to just disable Core\UserCartRecalculationListener and don't do anything else.
/Offtopic,
in my opinion shop-api v1 is kind of done and not salvageable as it was released too early and only v2 with redesign will save it. (All contexts should be re-defined in shop-api, Query object should be introduces in addition to Command, etcetera)
So we should look more in maintenance, than new features.
For example I've implemented out of stock validator in my project, but it's not pretty and runs on modified version of shop-api and it would be plenty of work to make proper PR.
…mit)
This PR was merged into the 1.0-dev branch.
Discussion
----------
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: #667#681
Commits
-------
a387684 Decorating the UserCartRecalculationListener
f3a3a8c Fixed address book test
adbe2a7 Codestyle
d500d9d Fix phpstan
60b511f Override the CartRecalculationListener instead of decorating it
0929b8b Updated listeners service definition
84367c7 Added compiler pass to remove the core UserCartRecalculationListener
If
shop user
is logged in and have at least one previously assigned cart, then CoreBundle/EventListener/UserCartRecalculationListener will triggerorderProcessing
on each authorized request to any shop-api endpoint.This happens due the fact that
ShopApiPlugin
doesn't defineCartContext
andCore\CartContext
considers last assigned cart as current cart, which is not true for shop-api. It also expected be triggered only at login in html website, but in shop-api it happens in each request with JWT token.This results in metric ton of deadlocks for any authorized user and renders SPA app unusable.
Solution is to override listener and disable it.
The text was updated successfully, but these errors were encountered: