[webrtc-pc] Order of multiple RTCDataChannel.send calls in case of blobs (#2215)

youennf has just created a new issue for https://github.com/w3c/webrtc-pc:

== Order of multiple RTCDataChannel.send calls in case of blobs ==
https://w3c.github.io/webrtc-pc/#datachannel-send defines how a blob is to be sent.
It is not clear though how blob data is retrieved.

Reading the spec, it seems that blob data retrieval is expected to happen synchronously.
This guarantees the sending order of the messages.
Sending (blob1, arrayBuffer1, blob2) would lead to three messages in the same order (blob1, arrayBuffer, blob2) on the receiving side for ordered channels.

Browsers usually do retrieve blob data asynchronously. If done so, the order of the messages is not guaranteed.
Taking the previous example, the order might actually be (arrayBuffer, blob1, blob2) or (arrayBuffer, blob2, blob1). This might be surprising to web authors.

My understanding of the intent of the spec is to guarantee order of sending.
Implementation-wise, this makes it somehow harder to implement since a queue of messages might be needed.
Clarification might be good in any case.

Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2215 using your GitHub account

Received on Friday, 21 June 2019 17:45:40 UTC