-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
There seems to be a bug in the web-bluetooth/automatic-reconnect example or in the way web bluetooth is implemented in Chrome.
I have already filed a bug-report for Chrome, but since this may relate to API changes the bug may be caused by the fact that the sample code is out of date.
The problem:
Bluetooth device connection promise not resolving if device times out.
Steps to reproduce the problem:
- Launch Chrome
- Go to: https://googlechrome.github.io/samples/web-bluetooth/automatic-reconnect.html
- Click Scan button
- Select BTLE device
(Tested with Wahoo Cadence Sensor and Wahoo Heart Rate Sensor) - Wait for the device to connect
- Let the sensor rest until it disconnects
- Wait for the 'gattserverdisconnected' event to be triggered and the first reconnect cycle to start
- The program will stall and the requestDevice() chooser will stop responding
What is the expected behavior?
The bluetoothDevice.gatt.connect() call should time out after some time if the client can not connect to the server. This does happen if the client disconnects but not the server (The BT device).
What went wrong?
The bluetoothDevice.gatt.connect() Promise seems to never get resolved. This does only happen if the device times out. If the device is removed via bluetoothDevice.gatt.disconnect() the API behaves as expected.
Chrome version: 79.0.3945.130 Channel: stable
OS Version: OS X 10.15.2