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

Issue 654950 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Feature

Blocked on:
issue 495270

Blocking:
issue 436283



Sign in to add a comment

bluetooth: Invalidate attributes when the device disconnects

Project Member Reported by jyasskin@chromium.org, Oct 12 2016

Issue description

After a device has been disconnected, all objects that refer to services, characteristics, descriptors should have methods return an InvalidStateError.

Spec describing what to do upon disconnection:
https://webbluetoothcg.github.io/web-bluetooth/#disconnection-events

Spec describing throwing the error upon navigating objects:
https://webbluetoothcg.github.io/web-bluetooth/#navigating-bluetooth-hierarchy

Source conversations:
See https://github.com/WebBluetoothCG/web-bluetooth/pull/273 and  issue 654687 .
 

Comment 1 by scheib@chromium.org, Oct 18 2016

Labels: -Pri-1 M-56 Pri-2

Comment 2 by scheib@chromium.org, Oct 18 2016

Description: Show this description

Comment 3 by ortuno@chromium.org, Oct 26 2016

Blockedon: 495270
Owner: ortuno@chromium.org
Status: Started (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, Nov 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/344468c89036d7eff858c39c7fbb0e360f0ea71e

commit 344468c89036d7eff858c39c7fbb0e360f0ea71e
Author: ortuno <ortuno@chromium.org>
Date: Mon Nov 07 01:17:23 2016

bluetooth: Invalidate services upon disconnection

Remove services from attribute instance map when a device disconnects or when disconnect is called.
Check that the service is in the attribute instance map and reject if it isn't.

Small refactor of disconnect() and dispatchGattServerDisconnected() to more closely
match the spec.

BUG= 654950 

Review-Url: https://codereview.chromium.org/2478013002
Cr-Commit-Position: refs/heads/master@{#430206}

[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-device-disconnects-invalidates-objects.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-disconnect-invalidates-objects.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryService/gen-service-get-different-service-after-reconnection.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-device-disconnects-invalidates-objects-with-uuid.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-device-disconnects-invalidates-objects.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-disconnect-invalidates-objects-with-uuid.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-disconnect-invalidates-objects.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-get-different-service-after-reconnection-with-uuid.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/getPrimaryServices/gen-service-get-different-service-after-reconnection.html
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/script-tests/service-device-disconnects-invalidates-objects.js
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/script-tests/service-disconnect-invalidates-objects.js
[add] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/LayoutTests/bluetooth/script-tests/service-get-different-service-after-reconnection.js
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
[modify] https://crrev.com/344468c89036d7eff858c39c7fbb0e360f0ea71e/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 9 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/35b0cbff31387ff3b69607850f5ccfe99e2d4817

commit 35b0cbff31387ff3b69607850f5ccfe99e2d4817
Author: ortuno <ortuno@chromium.org>
Date: Wed Nov 09 00:26:53 2016

bluetooth: Invalidate characteristics when disconnecting

Remove characteristics from attribute instance map when a device
disconnects or when disconnect is called. Check that the
characteristic is in the attribute instance map and reject if it isn't.

BUG= 654950 

Review-Url: https://codereview.chromium.org/2476173002
Cr-Commit-Position: refs/heads/master@{#430788}

[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/TestExpectations
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/gattserverdisconnected-event/reconnect-during-disconnected-event.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic/gen-characteristic-device-disconnects-invalidates-objects.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristic/gen-characteristic-disconnect-invalidates-objects.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/gen-characteristic-device-disconnects-invalidates-objects-with-uuid.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/gen-characteristic-device-disconnects-invalidates-objects.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/gen-characteristic-disconnect-invalidates-objects-with-uuid.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/getCharacteristics/gen-characteristic-disconnect-invalidates-objects.html
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/script-tests/characteristic-device-disconnects-invalidates-objects.js
[add] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/LayoutTests/bluetooth/script-tests/characteristic-disconnect-invalidates-objects.js
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.cpp
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/Source/modules/bluetooth/BluetoothAttributeInstanceMap.h
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.cpp
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/Source/modules/bluetooth/BluetoothDevice.h
[modify] https://crrev.com/35b0cbff31387ff3b69607850f5ccfe99e2d4817/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp

Status: Fixed (was: Started)

Sign in to add a comment