-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enforce that the current realm is connected while running GATT procedures. #209
Enforce that the current realm is connected while running GATT procedures. #209
Conversation
@yrliou @BruceSunMozilla this PR affects how you'll implement disconnection. |
even if the UA stays connected the whole time | ||
and the {{BluetoothRemoteGATTServer}} is subsequently re-connected before they finish. | ||
We wrap the returned {{Promise}} to accomplish this. | ||
</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we put the note in a separate paragraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
c80f37d
to
2a2cb3b
Compare
…ures. This change makes it so that a disconnect() call takes effect immediately and prevents any subsequent changes to member variables from a returning GATT procedure, even if the GATT procedure started before the disconnection. It also forces all active requests to fail with a NetworkError so that no remnants of the connection keep running after it's terminated. This reverses the readValue() promise and event order from WebBluetoothCG#175, in order to avoid needing to perform a microtask checkpoint inside the algorithm. Fixes WebBluetoothCG#114. Fixes WebBluetoothCG#171.
2a2cb3b
to
6ebe5f0
Compare
lgtm |
Enforce that the current realm is connected while running GATT procedures.
As discussed in #274 (comment), I don't like the order "fire event then resolve promise" since that makes it impossible to distinguish notifications from read responses. |
This change makes it so that a disconnect() call takes effect immediately and
prevents any subsequent changes to member variables from a returning GATT
procedure, even if the GATT procedure started before the disconnection. It also
forces all active requests to fail with a NetworkError so that no remnants of
the connection keep running after it's terminated.
This reverses the readValue() promise and event order from #175, in order to
avoid needing to perform a microtask checkpoint inside the algorithm.
Fixes #114 and #171.
Preview at https://rawgit.com/jyasskin/web-bluetooth-1/enforce-connectedness/index.html.