Closed
Conversation
There was a problem hiding this comment.
2 issues found across 2 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/anam/types.py">
<violation number="1" location="src/anam/types.py:238">
P2: The sort key includes the URL as a secondary key, so non-`turns:` entries are reordered alphabetically. This can unintentionally change the original ICE URL order (e.g., moving `stun:` ahead of `turn:`) when there are no `turns:` entries. If the goal is only to prioritize `turns:`, use a stable key that preserves original order for all other URLs.</violation>
<violation number="2" location="src/anam/types.py:278">
P2: `client_config.get("iceServers", [])` returns `None` if the API sends `iceServers: null`, and `_reorder_ice_server_urls` will then raise a `TypeError` when iterating. Coerce null to an empty list to avoid a runtime crash on valid API responses.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
ao-anam
approved these changes
Feb 20, 2026
Contributor
Author
|
Decided to not automatically reorder ICE servers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
aioirtc only uses the first ICE serverin a list. This might be a problem when default TURN over UDP doesn't work. TURN over TLS has the highest likelihood for success.
As the PythonSDK targets backend use cases, the use of TCP transport is not a major concern.
Summary by cubic
Prioritize TURNS (turns:) URLs per ICE server so aiortc, which uses the first TURN URI, picks the most reliable endpoint. Sorting is stable during session parsing, preserving original order within each group and improving WebRTC success when UDP TURN fails in backend SDK cases.
Written for commit a3baa31. Summary will update on new commits.