-
Notifications
You must be signed in to change notification settings - Fork 161
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
WritableStreamDefaultController.abortReason #1165
Comments
@ricea @domenic @MattiasBuelens what do you think? This sounds like a good suggestion - we can make AbortController.abort() take a reason argument, and add AbortSignal.reason. |
I like it! 🙂 Should the Building up on that: when |
I think if this is properly integrated into all calling specifications, such that calling It would also solve the issue discussed in whatwg/dom#951 about The spec changes would probably be something like:
This is a good amount of work, especially updating all the dependent specs/implementations/tests. But I think if we want to do this, we need to go the extra mile and update those too; being in an inconsistent halfway state where |
Never mind,
Hmm, I was a bit hesitant about changing the rejection reason of |
Thank you for the summary! Do we need approval from each API spec, or can we make a decision here and then start talking with each API spec independently? |
I think we can make the decision here. (Well, really we need to bring the decision to whatwg/dom, but I suspect @annevk will be in favor.) The other specs bought into using a shared primitive with the explicit goal of benefiting from future evolutions to that shared primitive, so they should be OK with such a backward-compatible upgrade. |
Yeah, this is good. Solving a couple of problems/requests at once. \o/ ("abort reason" being any makes sense and in that case you'd want undefined as the default value. The only slight argument for not doing that is that you could remove the need for the aborted flag, but that seems a lot less important.) |
@yutakahirano, can you or your team work on, as a first step, removing abortReason from the WritableStream spec, since it sounds like we're not implementing that? It'd be good to avoid people being misled by the spec as-is. |
@nidhijaju is working on this issue. Nidhi, can you remove the property? |
Yes, I will remove the property. |
Part of #1165, which discusses moving it instead to the AbortSignal's reason property per whatwg/dom#1027.
See whatwg/streams#1165 (comment) for additional context. Tests: #1027. Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Apologies for coming in late with this question, but... Can anyone elaborate on the specific behavior of needing to force IOW, why shouldn't a developer be able to express the intent that there was no reason for an abort, and then elsewhere be able to detect that intent via an Moreover, there's a bit of a confusing semantic signal, with the object being an exception... It kind of indicates that I would just like to understand this specific change. It had some significant negative impacts on my library. |
@atanassov and I looked took a look at this via w3ctag/design-reviews#672. We're wondering if the
abortReason
would be better served as an extension toAbortController
andAbortSignal
rather than being carried an a separate property.The text was updated successfully, but these errors were encountered: