Open mkllnk opened 1 week ago
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.. 😬
If this resulted in payments not being captured, we should list each one of these cases so we can let the affected enterprises know.
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 ActiveRecord::RecordInvalid in checkout#update
An error linked to this issue has been marked as fixed in Bugsnag ActiveRecord::RecordInvalid in checkout#update
Looking at the code, I have a suspicion:
on_demand
while not overriding the stock level (count_on_hand == nil
).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 on demand
is set. So the sales don't affect the producers stock level and the distributor has its own hidden stock tracking.
This is not a current bug. It appeared after deploying a pull request which has been reverted since:
12536
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