New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 681435 link

Starred by 4 users

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug

Blocking:
issue 577953


Show other hotlists

Hotlists containing this issue:
web-bluetooth


Sign in to add a comment

bluetooth: can't connect to device after 3 minutes

Reported by emil.len...@gmail.com, Jan 16 2017

Issue description

Chrome Version: 57.0.2982.0 Canary
OS: Mac OS X 10.10.2

Try the example at https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.html. After you have connected to a device, press disconnect, wait for 3 minutes and then press reconnect.

Output:
Requesting Bluetooth Device...
Connecting to Bluetooth Device...
> Bluetooth Device connected
> Bluetooth Device disconnected
Connecting to Bluetooth Device...
Argh! NetworkError: Bluetooth Device is no longer in range.

The device is certainly in range but since the browser has not made a scan during the last 3 minutes the device is removed from the cache and therefore refuses to connect.

We can't have it that way. A pretty common thing that happens if you want to have a long-lived connection is that the connection eventually gets lost due to for example radio interference (disconnected due to supervision timeout) and you immediately need to reconnect to re-establish the link by calling device.gatt.connect().

An example that also seem to crash Chrome's bluetooth is to first scan. Before connecting, stop advertising on the peripheral. Then call device.gatt.connect() and wait 3 minutes. Then start advertising.
These steps can be done from https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.html as well; simply stop advertising on the peripheral as soon as the device has popped up in the device selector UI, before you connect.
What's happening then is that the bluetooth system stops working in that tab. Requesting a new device does not put up any UI and all other gatt commands do nothing, promises neither resolve nor reject etc.

The standard mentions nothing about timeouts and it even explicitly states for the connect() method: "Note: These procedures can wait forever if a connectable advertisement isn’t received.".

Cause seems to be related to this function: https://chromium.googlesource.com/chromium/src/+/15b1f5307b13a30002693aa1907819c447db4954/device/bluetooth/bluetooth_adapter.cc#375
 
Cc: jlebel@chromium.org
Labels: OS-Mac
Status: Available (was: Unconfirmed)
FWIW, I get "Connecting to Bluetooth Device..." and that's pretty much it.
The "reconnect" never resolves or rejects.

jlebel@ What's your take on this issue?
Exactly. If I have a pending connection for 3 minutes, then start advertise (the promise does not resolve nor reject), then press scan then the scan UI does not show up.

Comment 3 by hdodda@chromium.org, Jan 16 2017

Labels: TE-Hardware-Dependency
Cc: ortuno@chromium.org
ortuno@ do you mind having a look as well?

Comment 5 by ortuno@chromium.org, Jan 18 2017

We do it this way because of BlueZ :(

On BlueZ a device gets removed if it has not been seen for 3 minutes. It's the only platform where this happens.

Maybe we could update the timestamp when the device disconnects. That would address the use case. I still need to investigate what happens on BlueZ and how hard it would be to implement this.

Comment 6 by pe...@opera.com, Feb 8 2017

Owner: pe...@opera.com
Status: Started (was: Available)

Comment 7 by ortuno@chromium.org, Feb 10 2017

Thanks for taking a first stab at it perja. When talking to scheib we realized this was much more complex so I drafted a quick design doc:

https://docs.google.com/document/d/19hZCX64sERewJwJreFjkMCc_owp86N60fnoMBAYJKM4/edit?usp=sharing

Comment 8 by scheib@chromium.org, Jun 29 2017

Status: Available (was: Started)
perja, if you resume work here, great, but until then I'll mark this Available.

Comment 9 by pe...@opera.com, Dec 4 2017

Owner: ----
Project Member

Comment 10 by sheriffbot@chromium.org, Dec 4

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Blocking: 577953
Owner: odejesush@chromium.org
Status: Assigned (was: Untriaged)

Sign in to add a comment