← Back to release summary
SerialPort integration with WritableStream controller AbortSignal
- Category
- Device
- Type
- No developer-visible change
- Status
- Enabled by default (Chrome 100)
- Intent stage
- Shipped
Summary
This integration prevents a situation in which aborting a SerialPort's WritableStream can be blocked on 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.
Standards & signals
- Specification: https://wicg.github.io/serial/#writable-attribute
- Firefox: No signal — Firefox is opposed to the Web Serial API in general.
- Safari: 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 been. Fixing the bug in the test exposed the need for this integration.
- Tracking bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1295963
View on chromestatus.com