Skip to content
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

Task queueing #393

Open
annevk opened this issue Nov 24, 2022 · 9 comments · Fixed by #398
Open

Task queueing #393

annevk opened this issue Nov 24, 2022 · 9 comments · Fixed by #398
Assignees

Comments

@annevk
Copy link
Member

annevk commented Nov 24, 2022

You cannot resolve promises while in parallel. This is unfortunately somewhat common (and broken) copypasta. You need to queue a task ideally one of the newer queue a task algorithms that takes a global and such.

@jyasskin
Copy link
Member

What would go wrong if we defined an HTML-level version of https://webidl.spec.whatwg.org/#resolve that checked for being [=in parallel=] and called https://html.spec.whatwg.org/multipage/webappapis.html#queue-a-global-task on the promise's relevant global?

@annevk
Copy link
Member Author

annevk commented Nov 30, 2022

I like that idea. I think it would work. Oftentimes though it's not just resolving that needs to happen, but also other state updates. But perhaps it can take an optional list of steps for that. Something like "queue a task and resolve". cc @domenic

(In theory I think the global can have been GC'd, but that's an existing problem.)

@domenic
Copy link
Contributor

domenic commented Nov 30, 2022

This seems like unnecessary magic to me. And it's missing a task source; you need to pick one.

@annevk
Copy link
Member Author

annevk commented Nov 30, 2022

I was assuming it would still take a task source, but instead of a global it would take a promise it would resolve at the end. But yeah, maybe it's a bit much. Also if you need to create the value to resolve with you'd also have to do that as part of the task, so...

@domenic
Copy link
Contributor

domenic commented Nov 30, 2022

Yeah. I generally prefer to have the separate threads have clear distinct indentation levels, so you can tell when messages are being passed across such boundaries...

@annevk
Copy link
Member Author

annevk commented Dec 9, 2022

You used "queue a task" to resolve this which is kinda deprecated.

@marcoscaceres marcoscaceres reopened this Dec 9, 2022
@marcoscaceres
Copy link
Member

Ok, no problem. Will fix next week.

@marcoscaceres
Copy link
Member

marcoscaceres commented Dec 12, 2022

Ok, I just realized that we now have a mismatch between the permission store and the eventing model.

Updating the permission store should be causing queue global tasks to fire "change" events across the relevant navigables and workers.

Also, web driver part of the spec should just be updating the permissions store, not managing its own tasks.

@johannhof
Copy link
Member

@marcoscaceres want to file a new issue for that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants