Skip to content

WebRTC ICE server fix#591

Merged
emranemran merged 1 commit intomainfrom
mh/webrtc
Mar 6, 2026
Merged

WebRTC ICE server fix#591
emranemran merged 1 commit intomainfrom
mh/webrtc

Conversation

@mjh1
Copy link
Copy Markdown
Contributor

@mjh1 mjh1 commented Mar 5, 2026

The client-to-cloud WebRTC connection was being created with no ICE/TURN servers, causing it to fail ICE negotiation and time out after 30s.
Two bugs in CloudWebRTCClient.connect():

  1. Double data extraction — webrtc_get_ice_servers() already unwraps response["data"] and returns {"iceServers": [...]}. But the client then called .get("data", {}).get("iceServers", []), looking for a non-existent nested "data" key. Result: empty list, TURN servers silently dropped.
  2. Wrong config type — Even if the servers were extracted, a raw dict was passed to RTCPeerConnection() instead of a proper RTCConfiguration with RTCIceServer objects (which is what the local WebRTC path does correctly via create_rtc_config()).

The fix reuses the existing credentials_to_rtc_ice_servers() helper from webrtc.py to properly parse the ICE server response into RTCIceServer objects, and wraps them in an RTCConfiguration — matching how the local WebRTC path works.

Signed-off-by: Max Holland <[email protected]>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

🚀 fal.ai Preview Deployment

App ID daydream/scope-pr-591--preview
WebSocket wss://fal.run/daydream/scope-pr-591--preview/ws
Commit 0ca7f74

Testing

Connect to this preview deployment by running this on your branch:

uv run build && SCOPE_CLOUD_APP_ID="daydream/scope-pr-591--preview/ws" uv run daydream-scope

🧪 E2E tests will run automatically against this deployment.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 5, 2026

✅ E2E Tests passed

Status passed
fal App daydream/scope-pr-591--preview
Run View logs

Test Artifacts

Check the workflow run for screenshots.

@mjh1 mjh1 marked this pull request as ready for review March 5, 2026 16:55
@mjh1 mjh1 requested a review from emranemran March 5, 2026 16:55
@mjh1 mjh1 changed the title Webrtc fix WebRTC ICE server fix Mar 5, 2026
@emranemran emranemran merged commit 0ad9ce5 into main Mar 6, 2026
9 checks passed
@mjh1 mjh1 deleted the mh/webrtc branch March 6, 2026 10:10
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