Closed Bug 1693839 Opened 4 years ago Closed 3 years ago

Add basic support for payload serialization

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
8

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
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

No longer blocks: 1693834
Depends on: 1693834
Points: --- → 13
Priority: -- → P2
Priority: P2 → P3

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.

Summary: Add basic support for response's payload serialization → Add support for response's payload serialization
Whiteboard: [bidi-m1-mvp] → [bidi-m2-mvp]
Priority: P3 → --

This is required for milestone 2 to complete the implementation for log.entryAdded and to return all kinds of element types.

Priority: -- → P2

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.

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.

Points: 13 → ---
Summary: Add support for response's payload serialization → Add basic support for payload serialization and deserialization
Blocks: 1731589

It might be good to cover these data types initially:

Null
Undefined
String
Number
Boolean

Points: --- → 8

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.

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: nobody → hskupin
Status: NEW → ASSIGNED

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.

Flags: needinfo?(james)

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.

Flags: needinfo?(james)

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.

No longer depends on: 1693834
Flags: needinfo?(jdescottes)

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.

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.

Flags: needinfo?(jdescottes)

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.

Summary: Add basic support for payload serialization and deserialization → Add basic support for payload serialization
Blocks: 1739976
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7f16b9f78b81 [remote] Add basic support for WebDriver BiDi payload serialization. r=webdriver-reviewers,jgraham,jdescottes https://hg.mozilla.org/integration/autoland/rev/0dce12e803e3 [webdriver-client] Move module classes for WebDriver BiDi to their own directory. r=webdriver-reviewers,jgraham,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/31695 for changes under testing/web-platform/tests
Whiteboard: [bidi-m2-mvp] → [bidi-m2-mvp], [wptsync upstream]
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch

We only landed 2 patches of the stack, especially the test was not landed. Was this intended or should we land them now?

Flags: needinfo?(hskupin)

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.

Flags: needinfo?(hskupin)
Pushed by hskupin@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/95d37ec74f93 [webdriver-client] Move transport class for WebDriver BiDi into its own module. r=webdriver-reviewers,jdescottes https://hg.mozilla.org/integration/autoland/rev/780ea53e87fa [wdspec] Added test to check args of log.entryAdded event. r=webdriver-reviewers,jgraham,jdescottes
No longer blocks: 1694391
No longer blocks: 1694389
Upstream PR was closed without merging
Upstream PR was closed without merging
Upstream PR merged by moz-wptsync-bot
Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/811d8a224682 [wpt PR 31695] - [Gecko Bug 1693839] [webdriver-client] Move module classes for WebDriver BiDi to their own directory., a=testonly
No longer blocks: 1739976
Blocks: 1770725
Blocks: 1770730
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: