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

Work out a formalism for queuing tasks #113

Open
jgraham opened this issue Jun 22, 2021 · 1 comment
Open

Work out a formalism for queuing tasks #113

jgraham opened this issue Jun 22, 2021 · 1 comment

Comments

@jgraham
Copy link
Member

jgraham commented Jun 22, 2021

For some parts of navigation we currently have a machanism whereby we suppress an event when it's caused by the context.navigate command and then later re-emit it explictly. That's used to ensure the command has returned before the event is emitted, so clients always have the relevant navigation ids. But the mechanism is unsatisfactory; it would be better to just queue a (micro)task to emit the event in all cases; generally one won't be able to tell the difference, but in the case we invoke the navigation it would give the correct ordering.

We are making use of queue a microtask in the "wait" mechanism, but that is wrong in detail; it depends on an event loop. But the WebDriver spec conceptually doesn't run in a specific js context; it's running in the parent/UI process. So it's unclear to me if we can assume apriori that there is an agent to execute the event loop (at least without handwaving one into existence).

@jgraham
Copy link
Member Author

jgraham commented Jun 25, 2021

#115 is a first cut at this.

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

No branches or pull requests

1 participant