Open filipefurtad0 opened 2 years ago
That order has no line items and the order total is zero, so it definitely isn't an order that's valid for checkout. It could be someone visiting the /checkout
page with an empty cart? :thinking:
Edit: nope, it's more than that.
Dev notes:
I'm just having a look through the code and backtraces. The actual logic being applied here hasn't changed! What's changed in the new release is that we now get a message in Bugsnag when this situation occurs...
The check we apply is this one, and we do it before handling any checkout processing:
def order_invalid_for_checkout?
!@order || @order.completed? || !@order.checkout_allowed?
end
For reference: @order.checkout_allowed?
just checks if the order has any line items.
Ooooof... all of those Bugnsag entries for that notification in French Production (8 in total) are from requests using the Mobile Safari browser.
I just need to let out a little rant here...
The never-ending stream of obscure Safari-specific bugs (and Safari Mobile in particular) which are encountered by all Web Developers are entirely down to Apple's planned obsolescence policies; Safari Mobile browser versions are pinned to iOS versions and older versions don't get updates, so if people want their browser bugs fixed they need to buy the latest iPhone, and that's literally by design. Every version is poorly implemented, inconsistent with the standards followed by all other browsers, and contains bugs which remain perpetually unfixed. Safari is the new Internet Explorer.
Okay, rant over.
So the issue here is something related to Mobile Safari, and I would guess it's possibly related to the user session not being loaded correctly, but I'm not certain. I have no way of attempting to replicate this, as I don't own an iPhone. I wonder if it could be related to people using checkout out as a guest, or possibly checking out with "incognito" / private browsing mode?
Possible way forward: we could investigate loading up some Safari polyfills...
We also have a BrowserStack account with some Safari browser.
Maybe we need to discuss whether or not we want to continue support for Safari. From the dev pov, I think that Safari should be dropped, but when I look at statistics on Matomo, Mobile Safari is still in our top 3 software that people use to navigate the OFN... :sob: It's even the top1 in UK and AU...
Do we still observe these errors? @filipefurtad0 @Matt-Yorkley ?
I think so @RachL... I just checked bugsnag:
I'm not sure this is only related to Safari, this seems to have triggered in staging with Firefox 103: https://app.bugsnag.com/yaycode/openfoodnetwork-uk/errors/61ebce343d0f08000872149b?filters[event.since]=30d&filters[error.status]=open
Same as Matt reported above: an empty order :eyes:
id | number | item_total | total | state | adjustment_total | user_id | created_at | updated_at | completed_at | bill_address_id | ship_address_id | payment_total | shipment_state | payment_state | email | special_instructions | distributor_id | order_cycle_id | currency | last_ip_address | customer_id | created_by_id | included_tax_total | additional_tax_total | note
--------+------------+------------+-------+-------+------------------+---------+----------------------------+----------------------------+--------------+-----------------+-----------------+---------------+----------------+---------------+-----------------------------------+----------------------+----------------+----------------+----------+-----------------+-------------+---------------+--------------------+----------------------+------
455642 | R276141414 | 0.00 | 0.00 | cart | 0.00 | 6984 | 2022-06-12 21:56:21.519144 | 2022-08-12 14:14:03.490054 | | | | 0.00 | | | ffurtado+ghanoujc3@protonmail.com | | 1799 | 3516 | CAD | 188.251.215.147 | | 6984 | 0.00 | 0.00 |
(1 row)
Another re-occurrence: https://app.bugsnag.com/open-food-network-belgium/open-food-network-belgium/errors/63b29f9b28115e00082e0d39?event_id=63b29f9b00a2ef76f4be0000&i=sk&m=nw
I wonder if this will happen on split checkout as well...
Description
Error
concerns/order_completion.rb:53 - order_invalid!
is appearing since release v4.1.12. Observed so far in production only in FR, BE and US.I think the user might be seeing the flash error:
"No valid order found for checkout processing"
It seems to point out to a customer facing error on checkout (and to this order in FR-prod):
Taken from Bugsnag (FR): https://app.bugsnag.com/open-food-france/coopcircuits/errors/61e9b26c53b7d1000793af3a?event_id=61e9b26c008c65868ee80000&%3Bi=sk&%3Bm=nw&pivot_tab=device.hostname
Expected Behavior
Not sure...
Actual Behaviour
Checkout error.
Steps to Reproduce
?
Animated Gif/Screenshot
Workaround
Severity
Labelling S2 as it seems checkout and customer facing error preventing checkout.
Your Environment
Possible Fix