Skip to content

fix(webrtc): resolve remote stream attachment issue and concurrent modification error#2312

Open
2001arman wants to merge 2 commits into
famedly:mainfrom
2001arman:fix-video-call
Open

fix(webrtc): resolve remote stream attachment issue and concurrent modification error#2312
2001arman wants to merge 2 commits into
famedly:mainfrom
2001arman:fix-video-call

Conversation

@2001arman
Copy link
Copy Markdown
Contributor

Summary

This PR fixes issues in the WebRTC video call flow where the remote stream was not properly attached, resulting in missing video/audio on the receiver side.

Issues

  • Remote stream was null due to incorrect SDP metadata key
  • Concurrent modification error when iterating ICE candidates during async processing

Changes

  • Updated sdpStreamMetadataKey from:
    • org.matrix.msc3077.sdp_stream_metadata
      → to:
    • sdp_stream_metadata
  • Fixed concurrent modification issue by iterating over a copied list of _remoteCandidates

Impact

  • Remote media stream now attaches correctly
  • Prevents runtime crash: Concurrent modification during iteration
  • Improves stability of WebRTC signaling and ICE candidate handling

Notes

  • The key change aligns with the expected stable SDP metadata format (post-MSC3077)
  • Candidate handling is now safe for async execution

Testing

  • Verified video call connects successfully
  • Remote video/audio stream is properly rendered
  • No concurrent modification errors during ICE candidate processing

@2001arman
Copy link
Copy Markdown
Contributor Author

Hi @krille-chan, could you please review my PR? This PR fixes a WebRTC video call bug where the remote stream attachment was null due to an incorrect sdpStreamMetadataKey value. It also includes a minor fix for a concurrent modification issue when processing ICE candidates. Please let me know if there’s anything I might have missed. Thanks!

@krille-chan
Copy link
Copy Markdown
Contributor

@td-famedly you are probably best to review this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants