Issue metadata
Sign in to add a comment
|
Reconnection not possible after a web-bluetooth disconnect
Reported by
j...@zode64.com,
Oct 11 2017
|
||||||||||||||||||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Platform: 9592.96 Steps to reproduce the problem: 1. Go to http://pocketlab-web.herokuapp.com and connect with a bluetooth device. We can send you a Pocketlab device if it helps. 2. Connect to the device 3. Call disconnect (radio icon in top right) 4. Wait as long as you like and then Reconnect to the same device 5. The device appears to connect (flashing LEDs) but the app doesn't receive any notifications from the device What is the expected behavior? The device is able to reconnect What went wrong? I don't know. It seems like the system connects to the device and then the app is unable to. Did this work before? N/A Does this work in other browsers? Yes Chrome version: 60.0.3112.114 Channel: stable OS Version: 60.0.3112.114 Flash Version: 27.0.0.130 I can reconnect the device after a system restart. I can also reconnect to the device if I try in pair to it through bluetooth settings, enter any 6 numbers in the password so it fails and then restart the app (although this doesn't always work) It is almost identical to this issue https://bugs.chromium.org/p/chromium/issues/detail?id=719581#c1 which made me move to web-bluetooth in the first place where is worked for about 6 months. So it was working until a recently.
,
Oct 17 2017
Some more detail I've attached a HTML file which illustrate the problem I am seeing. The problem involves the removeEventListener. When a disconnect is called after a removeEventListener the same listener can't be re-added on the Chromebook but can on the MacOSX. If you 'Connect' and 'Start Sensor and Notifications' you can see readings coming in in the console. Then if you 'Remove Event Listener and Disconnect', 'Connect' again and 'Start Sensor and Notifications' then the readings aren't received. Any subsequent connection attempts will fail if no other action is taken. If you refresh the page, 'Connect' and 'Start Sensor and Notifications' then readings will begin to come in again. If you 'Connect', 'Start Sensor and Notifications', 'Stop Sensor and Remove Event Listener' then 'Start Sensor and Notifications' then it works fine which leads me to believe it related to the disconnect. If you change the listener to be anonymous it works.
,
Oct 19 2017
,
Oct 20 2017
reproduced with Voyager device. John, is this the same as issue 719581 ? If it's the same let's mark this issue a duplicate of that one and continue there.
,
Oct 20 2017
,
Oct 22 2017
They are probably related but one was seen in chrome.bluetooth and the other in web-bluetooth so personally I would be keep them separate and then test the other when you have a fix for the first. I have actually found a work around which has been deployed in https://pocketlab-web-dev.herokuapp.com where 1. On requestDevice I have removed the services filter and added all used services as optionalServices 2. Always call removeEventListener when possible 3. Call stopNotifications before enabling any sensors after a reconnect (the device would be detected without this step but the operation to start sensors would always fail) For this reason I think this issue is related to https://bugs.chromium.org/p/chromium/issues/detail?id=773847 where the same work around fixed that problem.
,
Oct 22 2017
Although note that https://bugs.chromium.org/p/chromium/issues/detail?id=773847 is a problem only seen on PocketLab 1.
,
Oct 31 2017
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by j...@zode64.com
, Oct 11 2017