-
Notifications
You must be signed in to change notification settings - Fork 168
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
[audioworklet] Error handling in AudioWorkletGlobalScope #1282
Comments
It seems to me it's somewhat tied to worklets that expose messaging capabilities. And thus far only audio worklets have that. Though I suppose the benefit for worklets with no messaging capabilities is that they could use it as some kind of error handling fallback? Not entirely sure what the use cases for that would be. (If all worklets need it though, we should just use cc @domenic |
The messaging capabilities is limited to the pair of AudioWorkletNode/AudioWorkletProcessor. The WorkletGlobalScope itself does not have any messaging channel. Wouldn't it be simpler to have the identical setup with the worker global scope? |
I meant that if you cannot message that exceptions happened to the parent process, it's rather unclear to me what the benefit of a catchall error handler is. |
I agree this is confusing. I would like to hear from @bfgeek (probably in w3c/css-houdini-drafts#433) what the intent is for worklets and errors. Typically large sites like to have some mechanism of catching errors and reporting them to the server, but indeed most worklets don't have enough communication capabilities to do that. |
The rough plan for paintWorklet was to do a reporting API similar to the Content-Security-Policy-Report-Only header for that usecase. (For paintWorklet we don't want a back communication channel from worklet->main). e.g. a bad proposal CSS.paintWorklet.addErrorReportingUri('/my-endpoint'); For those worklets that can have this backchannel, those that want it can extend and do a similar thing to workers? E.g. interface AudioWorklet : Worklet {
attribute EventHandler onerror;
} And get Worklet to inherit from EventTarget for these? |
How would you prevent the paint worklet leaking data that way? (At least I thought part of the concern was breaking the same-origin policy, but I haven't followed closely.) |
The primary concern for paintWorklet is people encoding paint assumptions into their code, e.g. what a specific browsers pre-paint window is, and attempting to react to it (e.g. a infinite list using this data). With a reporting uri (which I'm not advocating we do now, but when people start asking for it), this data could be batched, and out of band. |
Since we don't have info from the Worklet folks yet, we propose deferring this. Its absence doesn't compromise the API or cause future problems. |
closed see w3c/css-houdini-drafts#433 |
@mdjp I think you should keep this open. While a generic variant for all worklets might not be feasible, given that audio worklets have message passing we could do something here. It's fine to wait for a resolution there, but it seems good to keep this for tracking purposes. |
Excuse me if I'm not getting this, but implementation-wise (in Chrome 66),
|
In short, someone needs to do the spec work. https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
https://html.spec.whatwg.org/multipage/workers.html#workerglobalscope Technically we should use The error handling of Worklet infra is still under the discussion, so I prefer to wait to have more spec work on the error handling mechanism before we design the WebAudio specific one. I believe this is why we pushed this issue to V2 and sorry if this was not clear. |
Thanks, @hoch. |
Sure. I think the best bet is the associated Houdini issue. @annevk, @domenic and @bfgeek have better idea what needs to be done here. My preference is to expose Also we might have to escalate the issue in the AudioWG to mark this as a "v1 blocker". |
It seems problematic that Chrome has implemented something here without a specification backing it... |
Just please don't take it away :) |
@annevk Chrome implemented the spec as it is now. Can you clarify? |
@hoch my bad, I thought defining error handling in general was deferred until we figured out what it should look like. |
onprocessorerror provides a minimal notification of error when an error is associated with a node or its processor, but there is no notification of exceptions during "Run a module script", which is |
I think rejecting the promise from In that sense, |
Closing as duplicate https://github.com/WebAudio/web-audio-api-v2/issues/29 in V2 |
Currently the Worklet infrastructure does not define the error handling clearly. (issue) AudioWorkletGlobalScope can do its own error handling, but it is likely to cause the layering problem when the Worklet infra introduces the error handling later.
When this is addressed by the Worklet infra, downstream the fix to AudioWorkletGlobalScope.
The text was updated successfully, but these errors were encountered: