-
Notifications
You must be signed in to change notification settings - Fork 115
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
[Woo POS] Handle external reader disconnection gracefully in Point of Sale #14995
[Woo POS] Handle external reader disconnection gracefully in Point of Sale #14995
Conversation
Previously, it was possible to see the `Connect your reader` message in inappropriate parts of the flow, where it could cause confusion. For example, if we were on the Payment Successful, or other payment related views, and lost connection to the card reader (from battery drain, switched off, bluetooth disabled,) then it would show `Connect your reader`. After connecting, the POS would be in a strange state, and it could lead the merchant to thinking a new order was paid for when actually it was the previous order. This commit prevents the disconnected view from showing unless the payment is still to be taken.
…-off' into issue/13738-handle-external-reader-disconnection-gracefully-in-POS
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the fix works well and the disconnected message is not shown if the reader is disconnected in most of the states.
I kept finding weird issues though:
- Disconnecting never finishes
If I connect the reader, if I make the payment and disconnect. The disconnecting state only disappears after exiting and reopening the POS. Card reader remains in a connected state.
disconnection.never.finishes.until.reopening.pos.MP4
- I was able to reproduce instant-success
It's only reproducible after getting POS in a weird state after disconnecting the reader during the payment. The only way out is to kill and relaunch the Woo app. But it's not consistently reproducible to me. Likely need to address it in the scope of #14593 (p1737620243820579-slack-C070SJRA8DP).
instant.success.MP4
paymentState: paymentState) == false) | ||
} | ||
|
||
@Test(arguments: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of arguments 👍
Thanks for the review and the related findings...
I've tried this a bunch of times now and can't repro it. We set the The only place I can see where we wouldn't get a callback one way or another though, is if the Stripe Terminal SDK doesn't ever call our disconnect completion block, passed in StripeCardReaderService.disconnect()
This is still strange. It looks to me like the deliberate handling of an order which already has It could perhaps point to us not correctly resetting an order after it's paid. |
I'll check it today more closely in the scope of [Woo POS] Checkout screen occasionally gets stuck in I even managed to get an actual successful $0.01 payment screen although it doesn't show up in orders. ScreenRecording_01-30-2025.11-36-35_1.MP4 |
Closes: #13738
Closes: #13876
Merge after: #14994
Description
This PR prevents the "Connect your reader" view from showing on TotalsView unless the payment is still to be taken. (N.B. the reader connection status is still shown, it's the large CTA view which we don't want to show as it replaces other more relevant detail, and can lead to confusion.)
Previously, it was possible to see the
Connect your reader
message in inappropriate parts of the flow, where it could cause confusion.For example, if we were on the Payment Successful, or other payment related views, and lost connection to the card reader (from battery drain, switched off, bluetooth disabled,) then it would show
Connect your reader
.After connecting, the POS would be in a strange state, and it could lead the merchant to thinking a new order was paid for when actually it was the previous order.
Steps to reproduce
Processing payment
Payment successful
New Order
Testing information
It's worthwhile testing various payment flows with the reader connected and disconnected in different ways.
I tested using an iPad Air running iOS 17.7.
I tested cash and card payments, and I tested disabling bluetooth, turning off the reader, and taking the reader out of range.
Note that there's a pre-existing separate issue where if you get an error after disabling bluetooth, the
Try another payment
button doesn't work and you have to exit POS. I'm not sure what causes that, but it's not this PR, and I'm going to tackle it separately.Screenshots
Before
(note that to test this you'll need to use the branch
issue/14992-update-connection-status-when-reader-turned-off
) – before this, the issue was hidden by the card reader disconnecting not being reported in POS.before.fixes.to.connect.your.reader.view.mp4
After
after.disconnection.improvements.mp4
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: