[web-bluetooth] Bluetooth device connection promise not resolving if device times out

Aperta
#668 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 13 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
api, web-dev

Direzione di ricerca

Apri l'esempio web-bluetooth/automatic-reconnect in automatic-reconnect.html e riproduci la sequenza di timeout del sensore Wahoo in Chrome 79 su macOS. Inizia confrontando il flusso di riconnessione dopo gattserverdisconnected con il comportamento dopo bluetoothDevice.gatt.disconnect(). Il lavoro è completato quando un bluetoothDevice.gatt.connect() che va in timeout non lascia più bloccato il selettore requestDevice() e la promise di connessione raggiunge un esito definito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. Launch Chrome
  2. Go to: https://googlechrome.github.io/samples/web-bluetooth/automatic-reconnect.html
  3. Click Scan button
  4. Select BTLE device
    (Tested with Wahoo Cadence Sensor and Wahoo Heart Rate Sensor)
  5. Wait for the device to connect
  6. Let the sensor rest until it disconnects
  7. Wait for the 'gattserverdisconnected' event to be triggered and the first reconnect cycle to start
  8. 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

Lingua principale
JavaScript
Stelle
5.9k
Fork
2.4k
Merge medio
12g 12h
PR unite (30g)
1

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GoogleChrome/samples

Tutte le issue di GoogleChrome/samples

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.