[webrtc-pc] No way to register for transport events in DataChannel-only initial negotiation (#2899)

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

== No way to register for transport events in DataChannel-only initial negotiation ==
As mentioned in https://github.com/w3c/webrtc-pc/issues/2898, whereas `transceiver.transport`s are surfaced in sLD, `pc.sctp` isn't surfaced until the answer (!)

Inconsistency aside, this renders the following event handlers kinda useless on initial negotiation:
 1. `pc.sctp.onstatechange`
 2. `pc.sctp.transport.onstatechange`
 3. `pc.sctp.transport.iceTransport.ongatheringstatechange`
 4. `pc.sctp.transport.iceTransport.onselectedcandidatepairchange`

...because it's not possible to register handlers early enough to catch events reliably. It also means they work differently on initial vs. subsequent negotiations, which isn't great.

There's no other way to get dtls or ice-transport-object events for DataChannel-only connections.

### Workarounds

1. (For some states) use `pc.oniceconnectionstatechange` and `pc.onicegatheringstatechange` instead, or
2. use `"max-bundle"` and add a dummy audio transceiver to surface the DTLS and ICE transport earlier

This seems broken. We should probably surface the sctp transport in sLD (and handle it in rollback) like the others.

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 28 August 2023 19:52:53 UTC