[web-bluetooth] Bluetooth device connection promise not resolving if device times out
Maintainers usually reply within 13 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
Research direction
Open the web-bluetooth/automatic-reconnect example at automatic-reconnect.html and reproduce the Wahoo sensor timeout sequence in Chrome 79 on macOS. Start by comparing the reconnect flow after gattserverdisconnected with the behavior after bluetoothDevice.gatt.disconnect(). Done means a timed-out bluetoothDevice.gatt.connect() no longer leaves the requestDevice() chooser stalled and the connection promise reaches a defined outcome.
Written by the indexing model from the issue text.
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
- Dominant language
- JavaScript
- Stars
- 5.9k
- Forks
- 2.4k
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from GoogleChrome/samples
-
Difficulty 1/5 Under an hour Newbie friendliness 15/100
GoogleChrome/samples#957 · 2 comments ·
Maintainers usually reply within 13 days
-
Difficulty 1/5 Under an hour Newbie friendliness 35/100
GoogleChrome/samples#876 · 1 reaction ·
Maintainers usually reply within 13 days
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
GoogleChrome/samples#869 · 1 reaction ·
Maintainers usually reply within 13 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
GoogleChrome/samples#836 · 1 reaction ·
Maintainers usually reply within 13 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
GoogleChrome/samples#827 ·
Maintainers usually reply within 13 days
All issues in GoogleChrome/samples
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 73/100
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
cloudflare/workers-sdk#17215 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
0xPolygon/polygon-token-list#851 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cline/mcp-marketplace#4171 ·