FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

stream: fix `writableStream.abort()` by daeyeon · Pull Request #44327 · nodejs/node · GitHub

/ node Public

stream: fix writableStream.abort() - #44327

Merged
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
daeyeon:main.aboring-wstream-220815.Mon.9fc4
Sep 5, 2022
Merged

stream: fix writableStream.abort()#44327
nodejs-github-bot merged 1 commit into
nodejs:mainfrom
daeyeon:main.aboring-wstream-220815.Mon.9fc4

Conversation

daeyeon commented Aug 21, 2022

Copy link
Copy Markdown
Member

This includes:

  • Fixing the following step in writableStream.abort(reason). Passing the reason was missing.

WritableStreamAbort(stream, reason) performs the following steps:

  1. Signal abort on stream.[[controller]].[[signal]] with reason.
  • Leaving a TODO to remove the internal abortReason property of WritableStreamDefaultController in a follow-up.

Refs: https://streams.spec.whatwg.org/#writable-stream-abort

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com

This includes:

- Fixing `writableStream.abort(reason)`. Passing the reason was missing.

- Leaving a TODO to remove the internal abortReason property of
  WritableStreamDefaultController.

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
nodejs-github-bot added needs-ci PRs that need a full CI run. web streams labels Aug 21, 2022

daeyeon commented Aug 21, 2022

Copy link
Copy Markdown
Member Author

/cc @nodejs/whatwg-stream

mscdex commented Aug 21, 2022

Copy link
Copy Markdown
Contributor

I think this should add a test that checks that reason is passed?

daeyeon commented Aug 21, 2022

Copy link
Copy Markdown
Member Author

There is a test and this fix will get it passed.

test(t => {
let ctrl;
const ws = new WritableStream({start(c) { ctrl = c; }});
const e = Error('hello');
assert_true(ctrl.signal instanceof AbortSignal);
assert_false(ctrl.signal.aborted);
assert_equals(ctrl.signal.reason, undefined, 'signal.reason before abort');
ws.abort(e);
assert_true(ctrl.signal.aborted);
assert_equals(ctrl.signal.reason, e);
}, 'WritableStreamDefaultController.signal');

mscdex commented Aug 22, 2022
edited
Loading

Copy link
Copy Markdown
Contributor

There is a test and this fix will get it passed.

Why is the main branch passing all tests currently then?

Copy link
Copy Markdown
Member

There is a test and this fix will get it passed.

Why is the main branch passing all tests currently then?

I think that's because the test was expected to fail previously on main

"writable-streams/aborting.any.js": {
"fail": {
"expected": ["WritableStreamDefaultController.signal"]
}
}

daeyeon commented Aug 22, 2022

Copy link
Copy Markdown
Member Author

Why is the main branch passing all tests currently then?

Understand the query. Unlike other Node.js APIs, developing Web compatible APIs is allowed to use preparing tests first and developing later approach (TDD) if there are Web Platform Tests we can rely on for basic compatibility testing. When running WPT, our WPT harness refers to a JSON status file describing tests we don't support yet. And it ignores a test result if a certain test is marked as expected to fail.

This updates test/wpt/status/streams.json so that the result previously ignored can be reflected in the final result.

mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

lgtm

daeyeon added the request-ci Add this label to start a Jenkins CI on a PR. label Aug 22, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Aug 22, 2022

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

daeyeon added the author ready PRs that have at least one approval, no outstanding review comments, and a CI started. label Aug 29, 2022

Copy link
Copy Markdown
Member

Please do not use resume to re-run the tests - a proper rebase from the CI is necessary to include #44359

daeyeon commented Aug 29, 2022

Copy link
Copy Markdown
Member Author

Thanks for the information. I mistook that the resume build also includes the rebase process.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

daeyeon added the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 5, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Sep 5, 2022
nodejs-github-bot merged commit 4af0a26 into nodejs:main Sep 5, 2022

Copy link
Copy Markdown
Collaborator

Landed in 4af0a26

daeyeon deleted the main.aboring-wstream-220815.Mon.9fc4 branch September 5, 2022 15:24
RafaelGSS pushed a commit that referenced this pull request Sep 26, 2022
This includes:

- Fixing `writableStream.abort(reason)`. Passing the reason was missing.

- Leaving a TODO to remove the internal abortReason property of
  WritableStreamDefaultController.

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: #44327
Refs: https://streams.spec.whatwg.org/#writable-stream-abort
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
RafaelGSS mentioned this pull request Sep 26, 2022
RafaelGSS pushed a commit that referenced this pull request Sep 26, 2022
This includes:

- Fixing `writableStream.abort(reason)`. Passing the reason was missing.

- Leaving a TODO to remove the internal abortReason property of
  WritableStreamDefaultController.

Signed-off-by: Daeyeon Jeong daeyeon.dev@gmail.com
PR-URL: #44327
Refs: https://streams.spec.whatwg.org/#writable-stream-abort
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

Copy link
Copy Markdown
Member

This is not landing cleanly in the v16.x release line; would yo mind rebasing to v16.x?

daeyeon commented Oct 3, 2022
edited
Loading

Copy link
Copy Markdown
Member Author

Backporting this is pending now since it depends on both #43455 and #44234.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. needs-ci PRs that need a full CI run. web streams

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants


Back | FazBrowse Home | New Git URL