stripe / stripe-terminal-ios

Stripe Terminal iOS SDK
https://stripe.com/docs/terminal/sdk/ios
Other
104 stars 64 forks source link

BBPOS WisePOS E disconnects and unable to reconnect temporarily #181

Closed auctifera-josed closed 1 year ago

auctifera-josed commented 2 years ago

Summary

We have integrated the BBPOS WisePOS E using the Terminal SDK (since we need to support countries other than the US) and it's working fine almost all the time, except that sometimes we are completely unable to connect to the reader regardless of what we try (restarting the app, the device, restart internet connection) and it starts working again all the sudden without any change in the code base.

Code to reproduce

Terminal.shared.connectInternetReader(reader, connectionConfig: config, completion: completion)

iOS version

15.5

Installation method

cocoapods

SDK version

2.12

Other information

SDK Error: "Connecting to the reader over the internet timed out. Make sure your device and reader are on the same Wifi network and your reader is connected to the Wifi network."

And both the device and reader are in the same Wifi network which is working without any problems.

bric-stripe commented 2 years ago

Hi, can you provide logs from the Terminal.logListener when this happens? Or alternatively a serial number and rough timing (even just a day is fine) of an instance of when it occurred and we can then try to find some of the logs reported by the reader with that.

auctifera-josed commented 2 years ago

Sure @bric-stripe the serial number is WSC513128020341 and it happened yesterday Nov 3 around 10 am GMT-5

bric-stripe commented 2 years ago

I found logs for that reader and both the SDK and the reader seem to be able to talk to stripe.com without issue, but the network requests from the SDK to the reader itself are indeed timing out. I confirmed SCPErrorInternetConnectTimeOut is only ever returned if the request to the reader was an NSURLErrorDomain error with code NSURLErrorTimedOut, which unfortunately doesn't tell us much other than for reasons that are tricky to debug the network requests aren't getting through. The most common cause for this is local DNS resolution failing but this doesn't match that because it just all the sudden stops and then starts working again 🤔

does this happen regularly on a device you have access to? Have you seen this happen on multiple unrelated networks? Debugging the local network is the next step here. Some things to investigate, some may not be practical depending on when/where this is happening though:

auctifera-josed commented 2 years ago

Hi @bric-stripe it was the network, when it happened again we switched networks on both devices and it worked again, switch back again and it continues not to work.

How would one go about debugging the issue with the network? Just wondering when this happens to a client and they are unable to connect to another network.

bric-stripe commented 2 years ago

Unfortunately there's not much info provided back from the network request to help with debugging so usually some manual network investigation work is needed. For what it's worth this is the first time I'm hearing of an intermittent issue like this where all the sudden local traffic seems to just stall out and then start working again after a bit. Have you seen this on more than 1 network so far? The most common issue we see is with an IPS's DNS provider not supporting local IP addresses. That's what the primary focus of the previously mentioned support doc covers. With that situation it's at least a stable issue and usually solved by overriding with a public DNS provider.

auctifera-josed commented 2 years ago

So far only 1 network has presented this issue, changing the DNS provider did not help with the issue. We'll try to do some more network debugging and get back to you with more information if possible.

bric-stripe commented 1 year ago

Hi, cleaning up old issues. There aren't any known issues related to connecting aside from the DNS issue. Please re-open if you have more info on this though.