Add basic support for payload serialization
Categories
(Remote Protocol :: WebDriver BiDi, task, P2)
Tracking
(firefox96 fixed)
Tracking | Status | |
---|---|---|
firefox96 | --- | fixed |
People
(Reporter: whimboo, Assigned: whimboo)
References
(Blocks 3 open bugs, )
Details
(Whiteboard: [bidi-m2-mvp], [wptsync upstream])
Attachments
(4 files)
When responding to commands, or sending events the contained payload needs to be serialized. We should get the basics implemented so that the logging feature can be implemented.
It would be good to know which commands would be necessary, and as such which data types are required.
The log.entryAdded
event contains the following entries:
https://w3c.github.io/webdriver-bidi/#types-log-logentry
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Updated•3 years ago
|
Assignee | ||
Comment 1•3 years ago
|
||
For the next milestone 2 we might want to have more than just basic support. Updating the summary for now, triage will happen early in September.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 2•3 years ago
|
||
This is required for milestone 2 to complete the implementation for log.entryAdded
and to return all kinds of element types.
Comment 4•3 years ago
|
||
We will first implement a basic serialization/deserialization for simple types, adding the necessary entry points that should be used for commands, responses and events serialization.
Then we will file follow ups to implement more complex types and complete the serialization/deserialization logic.
Assignee | ||
Comment 5•3 years ago
|
||
We missed to update the summary of the bug yesterday. By shifting the amount of work for this bug we would also have to adjust the points. Let discuss that on Monday.
Assignee | ||
Comment 6•3 years ago
|
||
It might be good to cover these data types initially:
Null
Undefined
String
Number
Boolean
Updated•3 years ago
|
Comment 7•3 years ago
|
||
https://github.com/web-platform-tests/wpt/blob/c6d1a640c94adc163c4304ec5fd61e50512dde3a/resources/channel.sub.js#L324-L554 has something a bit like the initial spec draft (although without some complexity). I'll keep updating that as I implement the associated wpt feature, and the idea is to be close to BiDi.
Assignee | ||
Comment 8•3 years ago
|
||
Some more details from our triage discussion:
-
Consider complex types so no further refactoring is needed after implementing the above proposed basic types.
-
Maybe we could use our CDP implementation to see how serialization and deserialization could be done.
-
For JS objects we may wanna have a constructor field so that non-platform types (like for the application itself) could be instantiated if possible.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 9•3 years ago
|
||
I just saw the implementation of self.structuredClone()
(bug 1722576) and wonder if that could be something helpful for us given that it also targets the transfer of objects between realms. That sounds similar to our needs, including the transfer between the parent and content processes.
James, what do you think? I do not see any structured cloning reference in the BiDi spec at the moment.
Comment 10•3 years ago
|
||
It's similar but it's not the same. The way structured clone works, the actual transfer format isn't exposed, whereas we actually need to deal with the serialized message rather than making that part opaque. We may also have different requirements around e.g. custom objects which can't be directly recreated in the target environment.
Assignee | ||
Comment 11•3 years ago
|
||
Thanks James. We also discussed that in this weeks Bidi sync meeting, and I'm going ahead with a basic implementation.
Note that we now have an actual event that can be used to test the serialization code which is log.entryAdded
. So there is no reason of being blocked anytime longer on bug 1693834.
Also I noticed that we do not yet have deserialization from RemoteValue
covered in the WebDriver BiDi spec. This will be added with the PR for callFunction
via https://github.com/w3c/webdriver-bidi/pull/142. As such I would propose to only land the serialization code for now and post-pone deserialization until the PR got merged. Julian, do you agree? If yes, we should make this a 2-point bug.
Assignee | ||
Comment 12•3 years ago
|
||
Hm, regarding points... lets see how tricky it is to get the WebDriver tests written. We would also need the appropriate code in the BiDi Python client that produces the right types on the consumer side.
Comment 13•3 years ago
|
||
Sounds fine to postpone deserialization until it's actually needed. But 2 points seems too low in anycase I'd keep 8 for this one.
Assignee | ||
Comment 14•3 years ago
|
||
Yes, we should leave at 8 points given the complexity as needed to get the wdspec tests running. I'll file a follow-up for the deserialization piece.
Assignee | ||
Comment 15•3 years ago
|
||
Assignee | ||
Comment 16•3 years ago
|
||
Depends on D131603
Assignee | ||
Comment 17•3 years ago
|
||
Depends on D131604
Assignee | ||
Comment 18•3 years ago
|
||
Depends on D131605
Comment 19•3 years ago
|
||
Comment 21•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/7f16b9f78b81
https://hg.mozilla.org/mozilla-central/rev/0dce12e803e3
Comment 22•3 years ago
|
||
We only landed 2 patches of the stack, especially the test was not landed. Was this intended or should we land them now?
Assignee | ||
Comment 23•3 years ago
|
||
Very suspicious! I'm sure that all 4 were marked to be landed. I triggered the landing of the remaining two patches now. Thanks a lot for noticing that.
Comment 24•3 years ago
|
||
Comment 25•3 years ago
|
||
bugherder |
Comment 29•3 years ago
|
||
Comment 30•3 years ago
|
||
bugherder |
Description
•