bluetooth: Callbacks are dropped when the device disconects during a GATT Operation |
||||||||||
Issue descriptionGoogle Chrome 53.0.2768.0 (Official Build) dev (64-bit) Revision 9cd2e77b728d6d5ac115acd944b37df70423c355-refs/heads/master@{#399800} Platform 8459.0.0 (Official Build) dev-channel link What steps will reproduce the problem? Play too much with Web Bluetooth API and sometimes, sometimes sadly, `navigator.bluetooth.requestDevice` doesn't show bluetooth chooser anymore. I've looked at file:///home/chronos/user/log/chrome and file:///var/log/chrome/chrome after enabling Web Bluetooth debug logs and I see nothing... Refreshing the tab/page makes it works again though. If I duplicate a tab, it works again also.
,
Jun 23 2016
Tried it several times and not be able to see the issue. Is there a stable way to reproduce this issue?
,
Jun 23 2016
None that I've noticed. For info, it happened again today without any obvious pattern ;(
,
Jun 30 2016
Ah! I was able to reproduce it! See recording attached. Note that I use BLE Peripheral Android app as a nearby BLE device which features a missing Characteristic descriptor making startNotifications hangs on forever. Not sure if this is related or not...
,
Jul 1 2016
This is happening because a callback, in the mac case the start notifications callback, is getting dropped which causes our Web Bluetooth Service to be destroyed. I opened an issue with the mojo folks to add some logs or a CHECK when this happens so that we can find the culprit: Issue 624999
,
Jul 4 2016
Sry didn't see this bug report, opened a different one earlier. May be mark as duplicate and close? https://bugs.chromium.org/p/chromium/issues/detail?id=625408 I have seen this with valid characteristic also not just with missing characteristic reported.
,
Jul 6 2016
This is a different issue. In Issue 625408 the chooser shows up but the device is not included. On this issue the chooser doesn't show up at all. Marking this as Chrome OS only since the culprit on mac was Issue 624999
,
Jul 6 2016
Correction: The culprit on mac was Issue 624745
,
Sep 13 2016
Happens for me as well quite often on Mac OS X at Chrome 53. Page reload doesn't work. I have to open a new tab.
,
Sep 13 2016
Can you reproduce in Chrome Canary as well? You can download it from https://www.google.com/chrome/browser/canary.html
,
Sep 13 2016
Yes same there (55.0.2859.0). I actually think the whole Web Bluetooth stuff stops working when that happens. I usually test connect a device, then I disconnect (device.gatt.disconnect()) and then shortly after reconnect (device.gatt.connect()). Then it seems the device never reconnects even though it's next to the computer and it's advertising. I don't get the connect promise resolved nor rejected, it's just that nothing happens. When I at that time execute requestDevice, nothing happens. I just tested connecting two Bluetooth devices as well. When I have both connected and I for one device first disconnect and then connect again, it often (about 50 % of the times) happens that both gets disconnected and Web Bluetooth stops working. No callbacks are sent to the web page's javascript so as far as the script is aware of the first device is still connected.
,
Sep 14 2016
That's definitely a bug. I tried reproducing with a Nexus 6 and https://googlechrome.github.io/samples/web-bluetooth/device-disconnect.html but couldn't. What device are you using? Could it be possible to get some logs? Here are the instructions: https://www.chromium.org/developers/how-tos/file-web-bluetooth-bugs
,
Sep 14 2016
Aha I think I got it. I run on Mac OS X 10.10.2, MacBook Air 2014. The web bluetooth on the page stops working as explained if there is a pending GATT write operation when the peripheral gets disconnected. It doesn't stop working directly when I execute device.gatt.disconnect() but rather when the device actually disconnects (i.e. the ACK is received from the peripheral). OR if there is a pending GATT write operation and the link then drops due to supervision timeout. This happens 100% of the time.
,
Sep 15 2016
Thanks for the perseverance! Seems like we aren't correctly handling disconnections while there are pending GATT operations. I'm currently working on fixing the issue.
,
Sep 15 2016
,
Sep 16 2016
The fix will be implemented in the following patches: 1. Fix read and write on mac 2. Fix read and write on android 3. Fix read and write on windows 4. Fix notifications on mac 5. Fix notifications on windows The reason we are fixing notifications in separate CLs is because we need to implement a new part of the API for them to be fixed.
,
Sep 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0fb374e6d52746fa37dc66f9bbb3f56a5eb11883 commit 0fb374e6d52746fa37dc66f9bbb3f56a5eb11883 Author: ortuno <ortuno@chromium.org> Date: Fri Sep 23 03:04:53 2016 bluetooth: Call error callback when characteristics get destroyed during a GATT Event (mac) When a device disconnects all its characteristics get destroyed which was causing callbacks for GATT operations to get dropped. This patch fixes only mac's write and read. Follow up patches will fix android and windows. BUG=621901 Review-Url: https://codereview.chromium.org/2347133002 Cr-Commit-Position: refs/heads/master@{#420558} [modify] https://crrev.com/0fb374e6d52746fa37dc66f9bbb3f56a5eb11883/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm [modify] https://crrev.com/0fb374e6d52746fa37dc66f9bbb3f56a5eb11883/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc
,
Oct 6 2016
,
Oct 6 2016
Issue 597890 has been merged into this issue.
,
Oct 6 2016
,
Nov 8 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/650a52d4b71f0c029b4278910ed7cf0a127fd3c4 commit 650a52d4b71f0c029b4278910ed7cf0a127fd3c4 Author: ortuno <ortuno@chromium.org> Date: Tue Nov 08 01:36:30 2016 bluetooth:android: Run error callback when characteristic is destroyed When a device disconnects we destroy its attributes. This meant that if a device disconnected during a gatt operation we would drop the callbacks in BluetoothRemoteGattCharacteristicAndroid. This patches fixes that by calling the error callback when the characteristic is being destroyed. BUG=621901 Review-Url: https://codereview.chromium.org/2481683002 Cr-Commit-Position: refs/heads/master@{#430468} [modify] https://crrev.com/650a52d4b71f0c029b4278910ed7cf0a127fd3c4/device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc [modify] https://crrev.com/650a52d4b71f0c029b4278910ed7cf0a127fd3c4/device/bluetooth/bluetooth_remote_gatt_characteristic_unittest.cc [modify] https://crrev.com/650a52d4b71f0c029b4278910ed7cf0a127fd3c4/device/bluetooth/bluetooth_remote_gatt_characteristic_win.cc
,
Feb 20 2017
Only windows is missing.
,
Feb 20 2017
Besides windows this is also missing for Descriptors in Android and macOS (though read/write is not yet implemented on macOS).
,
Apr 12 2018
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
,
Apr 17 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by fbeaufort@chromium.org
, Jun 21 2016