w3c / webdriver-bidi

Bidirectional WebDriver protocol for browser automation
https://w3c.github.io/webdriver-bidi/
353 stars 38 forks source link

Use the message ID in errors, even if everything else was invalid #55

Open foolip opened 3 years ago

foolip commented 3 years ago

Discussed at https://github.com/w3c/webdriver-bidi/pull/50#discussion_r487024692.

https://w3c.github.io/webdriver-bidi/#handle-an-incoming-message will respond with an error if any of a number of conditions are true. Although https://w3c.github.io/webdriver-bidi/#respond-with-an-error is just a placeholder, it's clear that the ID isn't passed in, and so can't be passed back.

The behavior should be, I believe, that the ID is sent back if there was one.

Open question: If the ID was a string or and object, should that be sent back? Probably not?

shs96c commented 3 years ago

The id is used for message correlation. That suggests that the ID must be sent back.

foolip commented 3 years ago

Yes, in case the ID was a valid one we definitely should, but there is still the open question about what to do if the ID is a string, an object, or a number outside of the CDDL uint range.