[Webkit-unassigned] [Bug 174656] New: RTCPeerConnection rollback rejects with InvalidStateError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jul 19 11:00:17 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=174656

            Bug ID: 174656
           Summary: RTCPeerConnection rollback rejects with
                    InvalidStateError
           Product: WebKit
           Version: Safari Technology Preview
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore JavaScript
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mroberts at twilio.com

RTCPeerConnection should allow rollback in signaling states "have-local-offer" and "have-remote-offer".

Example Code:

    // "have-local-offer"
    (async () => {
      console.log('1. Getting user media')
      const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
      const [track] = stream.getAudioTracks()
      console.log('2. Constructing RTCPeerConnection')
      const pc = new RTCPeerConnection()
      console.log('3. Adding MediaStreamTrack')
      pc.addTrack(track, stream)
      console.log('4. Creating offer')
      const offer = await pc.createOffer()
      console.log('5. Applying local description')
      await pc.setLocalDescription(offer)
      console.log('6. Rolling back local description')
      await pc.setLocalDescription({ type: 'rollback' })
      console.log('Success!')
    })()

    // "have-remote-offer"
    (async () => {
      console.log('1. Getting user media')
      const stream = await navigator.mediaDevices.getUserMedia({ audio: true })
      const [track] = stream.getAudioTracks()
      console.log('2. Constructing RTCPeerConnection')
      const pc = new RTCPeerConnection()
      console.log('3. Adding MediaStreamTrack')
      pc.addTrack(track, stream)
      console.log('4. Creating offer')
      const offer = await pc.createOffer()
      console.log('5. Applying remote description')
      await pc.setRemoteDescription(offer)
      console.log('6. Rolling back remote description')
      await pc.setRemoteDescription({ type: 'rollback' })
      console.log('Success!')
    })()

Expected Output (e.g., Firefox):

    // "have-local-offer"
    1. Getting user media
    2. Constructing RTCPeerConnection
    3. Adding MediaStreamTrack
    4. Creating offer
    5. Applying local description
    6. Rolling back local description
    7. Success!

    // "have-remote-offer"
    1. Getting user media
    2. Constructing RTCPeerConnection
    3. Adding MediaStreamTrack
    4. Creating offer
    5. Applying remote description
    6. Rolling back remote description
    7. Success!

Actual Output (Safari 11 Technology Preview):

    // "have-local-offer"
    1. Getting user media
    2. Constructing RTCPeerConnection
    3. Adding MediaStreamTrack
    4. Creating offer
    5. Applying local description
    6. Rolling back local description
    Unhandled Promise Rejection: InvalidStateError (DOM Exception 11): Description type incompatible with current signaling state

    // "have-remote-offer"
    1. Getting user media
    2. Constructing RTCPeerConnection
    3. Adding MediaStreamTrack
    4. Creating offer
    5. Applying remote description
    6. Rolling back remote description
    Unhandled Promise Rejection: InvalidStateError (DOM Exception 11): Description type incompatible with current signaling state

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20170719/3699d7df/attachment-0001.html>


More information about the webkit-unassigned mailing list