Open filipefurtad0 opened 3 years ago
@filipefurtad0 when creating an s2 don't hesitate to move it straight to top of dev-ready right away ;)
Note when I was testing there was no filter applied.
Thanks moving it in there Rachel - forgot that :-)
Updated the issue based on that additional info Lynne :+1:
I wasn't able to immediately reproduce this in development. I took a look at the code that runs that would return that error message and if I manually added an error during the call to cart_service.populate
in the CartController I at least got the matching error message. It seems pretty likely that we're returning on the status: :precondition_failed
line. Unfortunately the error message isn't very specific. The two possible reasons for the error (as far as I can tell) are if the database thinks that 1) the order does not have an order cycle set, or 2) the product is not available from the distributor.
There could be something else entirely going on though. So I wrote a pull request https://github.com/openfoodfoundation/openfoodnetwork/pull/6424 to show a more specific error message.
I did notice that when we do the cart population we do some database locking. However, I tried manually raising the lock error class (ActiveRecord::StatementInvalid
) in the populate
method and that didn't result in the red banner being shown at all, just a silent failure on the backend. So it's probably safe to rule out the locking issues as the culprit.
Update from delivery train on January 18th: this is moved back in all the things. 2 options:
Description
Errors have been observed lately on the shopfront, while adding items to the cart:
first spotted on release testing of v3.4.2 Microgreens by @lin-d-hop - Chrome browser https://openfoodnetwork.slack.com/archives/C02TZ6X00/p1606170027171700
and later on in production by @lbwright22 - Microsoft Edge browser https://openfoodnetwork.slack.com/archives/CG7NJ966B/p1606396007180000
Expected Behavior
Clicking "Add" in the shopfront should not generate errors.
Actual Behaviour
Clicking "Add" in the shopfront sporadically generate the error seen on the video below.
Steps to Reproduce
Question mark... It seems difficult to reproduce:
Animated Gif/Screenshot
Workaround
Refreshing the page seems to solve the issue.
Severity
Raising this as an S2-bug for awareness/investigation.
Your Environment
Possible Fix