-
-
Notifications
You must be signed in to change notification settings - Fork 719
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
ActiveRecord::RecordInvalid in checkout#update #12586
Comments
If this resulted in payments not being captured, we should list each one of these cases so we can let the affected enterprises know. And the same for all other bugsnag instances.. 😬 |
I went through Australian Bugsnag and send all affected order ids to @amidaOFN. But we should check others as well. Oh, and some subscriptions were affected bug I can't see the ids in Bugsnag. |
Potential causing change reverted. Comment added in Bugsnag by Maikel |
An error linked to this issue has been marked as fixed in Bugsnag |
Looking at the code, I have a suspicion:
A distributor with inventory can set a variant to on demand while not overriding the stock level. In the old model, orders would then not affect the stock level because on demand would disable stock tracking. But the offending pull request starting tracking stock for on demand products as well. I didn't consider this and thought that tracking stock for in this case was hidden to the user but it's actually a big change in logic. Now a sale of a distributor can reduce stock levels of the producer even though the distributor chose on demand. I think that the solution is to enforce stock tracking on variant overrides when |
I reproduced the error in a spec: There are pending specs in that branch to fix. Next steps is to change the validation of VariantOverride to allow stock tracking when on demand. Then the variant override should do the stock check instead of deferring to the stock item which would be invalid. |
A new version of the pull request has been in production for over a week and I haven't this hasn't occurred again. Closing. |
This is not a current bug. It appeared after deploying a pull request which has been reverted since:
Error in OpenFoodNetwork Aus
ActiveRecord::RecordInvalid in checkout#update
Validation failed: Count on hand must be greater than or equal to 0
View on Bugsnag
Stacktrace
View full stacktrace
Created by Maikel via Bugsnag
The text was updated successfully, but these errors were encountered: