Intent to Prototype and Ship: SerialPort integration with WritableStream controller AbortSignal

140 views
Skip to first unread message

Reilly Grant

unread,
Feb 10, 2022, 3:25:53 PM2/10/22
to blink-dev

Contact emails

rei...@chromium.org


Specification

https://wicg.github.io/serial/#writable-attribute

https://github.com/WICG/serial/pull/160


Summary

This integration prevents a situation in which aborting a SerialPort's WritableStream can be blocked waiting for a partially-written chunk of data to be written to the port. If the port is waiting for the peer device to provide a flow control signal it could be blocked indefinitely. The intent of aborting a WritableStream is to immediately stop trying to write data to the underlying sink. The introduction of an AbortSignal to the controller was done to fix bugs like this.


Blink component

Blink>Serial


TAG review

The Web Serial API and WritableStream controller AbortSignal have both been reviewed by the TAG.


TAG review status

Not applicable


Risks


Interoperability and Compatibility

This integration introduces a minor change to the behavior of a SerialPort's WritableStream because it means that it no longer waits for the current write() operation to complete. However, since the intention of abort() is to discard queued writes and the exact timing for when the current write() operation completes depends on how quickly data is being transmitted by the port, the current behavior is more appropriately classified as a bug than a feature. It would be very hard for developers to rely on the previous buggy behavior, and so we believe the compat risk to be minimal.


Gecko: No signal

Firefox is opposed to the Web Serial API in general.


WebKit: No signal

Safari is opposed to the Web Serial API in general.


Web developers: No signals

I don't believe any developers have noticed this particular quirk. I noticed because I was debugging a test of the abort() behavior that passed even though there was a write() pending and without this integration it shouldn't have. Fixing the bug in the test exposed the need for this integration.


Other signals:


Debuggability

SerialPort and WritableStream are JavaScript APIs which can be debugged using DevTools.


Is this feature fully tested by web-platform-tests?

Yes


Flag name

None


Requires code in //chrome?

False


Tracking bug

https://bugs.chromium.org/p/chromium/issues/detail?id=1295963


Estimated milestones

M-100


Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/4778232531386368


This intent message was generated by Chrome Platform Status.

Reilly Grant | Software Engineer | rei...@chromium.org | Google Chrome

Mike Taylor

unread,
Feb 14, 2022, 10:16:50 AM2/14/22
to Reilly Grant, blink-dev
LGTM1
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAEmk%3DMYv0pu_WEXE6EAoZvVkh7W-ck_Gu5Qf52eFUuiwYhcW4A%40mail.gmail.com.


chrishtr via Chromestatus

unread,
Feb 15, 2022, 2:10:11 PM2/15/22
to blin...@chromium.org
LGTM2

mkwst via Chromestatus

unread,
Feb 16, 2022, 11:02:09 AM2/16/22
to blin...@chromium.org
LGTM3

Reilly Grant

unread,
Feb 16, 2022, 9:27:53 PM2/16/22
to mkwst via Chromestatus, blin...@chromium.org
Thank you. This will be shipping in M-100.

A note for whoever is implementing the ChromeStatus-based intent review pipeline: The original subject of this thread was "Intent to Prototype and Ship: ...". The tool seems to have changed the subject line for these responses, which breaks the thread.

Reilly Grant | Software Engineer | rei...@chromium.org | Google Chrome


On Wed, Feb 16, 2022 at 8:02 AM mkwst via Chromestatus <admin...@cr-status.appspotmail.com> wrote:
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
Reply all
Reply to author
Forward
0 new messages