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

Include timestamp in ScriptEvaluateResult #263

Open
juliandescottes opened this issue Aug 24, 2022 · 1 comment
Open

Include timestamp in ScriptEvaluateResult #263

juliandescottes opened this issue Aug 24, 2022 · 1 comment
Labels
needs-discussion Issues to be discussed by the working group

Comments

@juliandescottes
Copy link
Contributor

@nchevobbe was mentioning a typical DevTools console issue related to ordering of messages.

We already support a timeStamp property for log.entryAdded events, however in all Console-like UIs which allow to also execute script, log messages are displayed together with evaluation results . For a simple example consider evaluating console.log(1); "hi"

image

The 1 is a log message (ie log.entryAdded in BiDi), whereas the "hi" is the result of the evaluation (would be a ScriptEvaluateResult in BiDi). If we want clients to be able to build such UIs, it would be great if they could have consistent timeStamp information for both log events but also for ScriptEvaluateResult.

Would it make sense to extend the ScriptEvaluateResult to add a timeStamp property?
If awaitPromise is false it would be set when the script or function declaration is executed.
If awaitPromise is true it would be set when the promise resolves.

@juliandescottes juliandescottes added the needs-discussion Issues to be discussed by the working group label Aug 24, 2022
@juliandescottes
Copy link
Contributor Author

One additional comment, for really accurate message ordering it might be necessary to go down to microsecond precision. Right now our timestamps are in milliseconds (https://tc39.es/ecma262/#sec-time-values-and-time-range). Otherwise clients might have to take arbitrary decisions on the ordering of messages which share the timestamp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-discussion Issues to be discussed by the working group
Projects
None yet
Development

No branches or pull requests

1 participant