Skip to content

feat: collect ICE servers from all relays - #8486

Open
link2xt wants to merge 1 commit into
mainfrom
link2xt/turn-server-all-relays
Open

feat: collect ICE servers from all relays#8486
link2xt wants to merge 1 commit into
mainfrom
link2xt/turn-server-all-relays

Conversation

@link2xt

@link2xt link2xt commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Relays that don't have a TURN server in the metadata still return a fallback relay. Not changing it currently, maybe we want to get rid of the fallback completely. Otherwise will need to move the call to create_fallback_ice_servers() out of IMAP loop, likely into ice_servers() call.

@link2xt
link2xt force-pushed the link2xt/turn-server-all-relays branch from 6ee7cef to 26ee796 Compare July 28, 2026 18:31
Comment thread src/calls.rs
.values()
.flat_map(|metadata| metadata.ice_servers.clone())
.collect();
unresolved_ice_servers.sort();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is sort needed?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because dedup on the next line only works after sorting. E.g. if we have multiple relays not returning the TURN server, they will all return a fallback which should be deduplicated.

@hpk42 hpk42 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, though i am a little uneasy about the lack of tests.

@link2xt

link2xt commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

lgtm, though i am a little uneasy about the lack of tests.

I don't know what can be tested here without actually having multiple test relays. Maybe we actually need a second CI relay.

@hpk42

hpk42 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

lgtm, though i am a little uneasy about the lack of tests.

I don't know what can be tested here without actually having multiple test relays. Maybe we actually need a second CI relay.

calling the ice_servers function with some filled metadata set to ServerMetadata ice_server candidates in an offline test?

@WofWca WofWca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also see relevant forum post: https://support.delta.chat/t/calls-use-all-relays-turn-servers-not-just-one/5374?u=wofwca.

I didn't dive deep into the code, but it looks like metadata includes all relays, i.e. also unpublished ones? I think it would make sense to filter out those relays. But I guess it's not critical, the call isn't gonna fail because of that.
(This was brought up in https://support.delta.chat/t/relay-is-not-removed-from-connections-after-deletion-android-2-56/5587/7?u=wofwca).

@hpk42

hpk42 commented Jul 30, 2026 via email

Copy link
Copy Markdown
Contributor

@WofWca

WofWca commented Jul 30, 2026

Copy link
Copy Markdown
Member

(can be addressed in a follow-up if you ask me. The current main behavior seems to be basically "pick a TURN server from a random relay")

@link2xt

link2xt commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator Author

lgtm, though i am a little uneasy about the lack of tests.

I don't know what can be tested here without actually having multiple test relays. Maybe we actually need a second CI relay.

calling the ice_servers function with some filled metadata set to ServerMetadata ice_server candidates in an offline test?

ice_servers resolves DNS, it is almost the only thing it does, and if this is taken out then we are testing how well rust iterators and vectors work.

@link2xt
link2xt force-pushed the link2xt/turn-server-all-relays branch from 26ee796 to 9a40455 Compare July 30, 2026 20:22
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.

4 participants