You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm experiencing issues with the getPrimaryService promise not resolving appropriately when refreshing the page and immediately trying to reconnect.
My user experience is the following:
Make the initial connection to the device.
Once the connection is completely finished, refresh the page.
Immediately try to connect to the device again.
May need to repeat this a few times, but eventually the connection process hangs.
In the code I'm observing that it is the getPrimaryService promise that simply never resolves. I've even checked to make sure device.gatt.connected is true before making the call.
Once I get into this state the promise hangs indefinitely. If I power off and power on my device and start the connection process in my browser again, without refreshing, the following happens:
I make the call to device.gatt.connect
Then, the initial call to getPrimaryService resolves with the error "NetworkError: GATT Server is disconnected. Cannot retrieve services. (Re)connect first with device.gatt.connect."
Then, the promise from device.gatt.connect resolves with the error "GATT Server disconnected while retrieving characteristics."
At this point, I can attempt the connection again and it appears to always be successful.
I've tried to write some code to work around this edge case, (setting a timeout, telling the user to restart their device, etc...) but it seems like their might be some deeper issue here?
The text was updated successfully, but these errors were encountered:
This seems to be a problem in Chrome's implementation of the API. Would you mind filling an issue for it in Chrome's bug tracker? Some logs would be really useful, instruction here. What platform is this on?
I'm experiencing issues with the getPrimaryService promise not resolving appropriately when refreshing the page and immediately trying to reconnect.
My user experience is the following:
In the code I'm observing that it is the
getPrimaryService
promise that simply never resolves. I've even checked to make suredevice.gatt.connected
is true before making the call.Once I get into this state the promise hangs indefinitely. If I power off and power on my device and start the connection process in my browser again, without refreshing, the following happens:
device.gatt.connect
getPrimaryService
resolves with the error "NetworkError: GATT Server is disconnected. Cannot retrieve services. (Re)connect first withdevice.gatt.connect
."device.gatt.connect
resolves with the error "GATT Server disconnected while retrieving characteristics."I've tried to write some code to work around this edge case, (setting a timeout, telling the user to restart their device, etc...) but it seems like their might be some deeper issue here?
The text was updated successfully, but these errors were encountered: