-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: Internal adjustsments cache not updated after saving new adjustments? #3283
Comments
I do not think this is the case. In memory (contained within Let me know if I am missing something. |
@lukeholder ok let me tell you where this is coming from. We have a LOT of exceptions of "No line item exists with the ID “...”" - so I'm guessing there is some sort of race condition somewhere? Any thoughts? Here is a full stacktrace: https://robuust-6t.sentry.io/share/issue/d0e80dab2b3d4655bff6e3ceeadd866c/ |
@boboldehampsink I can't tell much from the stack trace apart from the error being triggered due to the line item referencing an ID that has been deleted. Do you have any custom module code manipulating the order or line items? |
Hi @lukeholder, no there is no custom code manipulating the order or line items. Also, this happens on various projects with Commerce. |
@lukeholder still seeing this error alot over various projects. I'll try to make it reproducible |
Could this be some sort of race condition? Imagine a front-end which updates the cart via an ajax request (by clicking a button on a product cart). What would happen if you click many different buttons rapidly? At least this is when I can reproduce it. |
What happened?
In the method \craft\commerce\elements\Order::_saveAdjustments, previous adjustments can be deleted. But if you run
$this->getAdjustments()
again after that, the deleted adjustments are still there? I think _saveAdjustments should update the adjustments withsetAdjustments
after it has done its part.Craft CMS version
4
Craft Commerce version
4
PHP version
No response
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: