Re: [web-bluetooth] Robust handling of errors listening to 'characteristicvaluechanged' (#500)

You should be fine if you listen to those events. If you only care about whether the characteristic is still available, the `servicechanged` event is good for that. I think that the `gattserverdisconnected` may not be fired on some platforms if the device goes out of range.

I'm not very familiar with how notifications work. However, quickly glancing through Chrome's implementation of this, if the characteristic is quickly added and removed and the [platform can still produce the same identifier for the characteristic](https://source.chromium.org/chromium/chromium/src/+/master:device/bluetooth/bluetooth_gatt_characteristic.h;l=94), then its possible that it can still listen to notifications from the characteristic.

There isn't really a good way to tell if a characteristic is still notifying that I know of, so perhaps it would be good to have a `BluetoothRemoteGATTCharacteristic.isNotifying` property on the characteristic that can be checked to see if that is still happening. This could be similar to how `BluetoothDevice.watchingAdvertisements` does that for `BluetoothDevice.watchAdvertisements()`.

-- 
GitHub Notification of comment by odejesush
Please view or discuss this issue at https://github.com/WebBluetoothCG/web-bluetooth/issues/500#issuecomment-637794610 using your GitHub account

Received on Tuesday, 2 June 2020 20:42:21 UTC