Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

announced_ip can be a hostname as per spec #1322

Merged
merged 3 commits into from
Feb 1, 2024
Merged

Conversation

ibc
Copy link
Member

@ibc ibc commented Feb 1, 2024

Fixes #1321

As explained in the ticket, only Rust changes are needed since in Node (and Worker) announcedIp was already defined as optional string.

Fixes #1321

As explained in the ticket, only Rust changes are needed since in Node (and Worker) `announcedIp` was already defined as optional string.
@ibc ibc requested review from jmillan and nazar-pc February 1, 2024 16:03
@@ -76,14 +77,14 @@ pub struct ListenInfo {
}

impl ListenInfo {
pub(crate) fn to_fbs(self) -> transport::ListenInfo {
pub(crate) fn to_fbs(&self) -> transport::ListenInfo {
Copy link
Member Author

Choose a reason for hiding this comment

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

Rust told me to change this to avoid confusing naming since self is passed as reference after removing Copy derive (or something like that).

Copy link
Collaborator

@nazar-pc nazar-pc left a comment

Choose a reason for hiding this comment

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

Since this is a breaking change for Rust API anyway, maybe rename announced_ip to announced_hostname since it is not guaranteed to always be an IP? Makes sense otherwise.

@@ -644,7 +644,7 @@ impl RouterCreateWebrtcTransportListen {
web_rtc_transport::ListenIndividual {
listen_infos: listen_infos
.iter()
.map(|listen_info| listen_info.to_fbs())
.map(|listen_info| listen_info.clone().to_fbs())
Copy link
Member Author

Choose a reason for hiding this comment

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

Finally (after some other change) this is not needed, so I'm removing it.

@ibc
Copy link
Member Author

ibc commented Feb 1, 2024

Since this is a breaking change for Rust API anyway, maybe rename announced_ip to announced_hostname since it is not guaranteed to always be an IP? Makes sense otherwise.

It should be announced_address instead (to match the naming used in WebRTC).

However I'd prefer if we don't rename it in Rust now. It would be a bit unexpected to have announced_ip in Node and announced_address in Rust. Do you mind if we do this in the future in a new version with breaking changes?

@nazar-pc
Copy link
Collaborator

nazar-pc commented Feb 1, 2024

However I'd prefer if we don't rename it in Rust now. It would be a bit unexpected to have announced_ip in Node and announced_address in Rust. Do you mind if we do this in the future in a new version with breaking changes?

We can also rename it in Node.js, but also keep the old field for backwards compatibility reasons. Ugly, I know, but we can get people upgrade to it already and maybe even print warnings in logs of those who didn't upgrade to the new field name.

Not critical or a blocker of course.

@ibc
Copy link
Member Author

ibc commented Feb 1, 2024

We can also rename it in Node.js, but also keep the old field for backwards compatibility reasons. Ugly, I know, but we can get people upgrade to it already and maybe even print warnings in logs of those who didn't upgrade to the new field name.

This deserves a separate story since it's huger than expected:

#1323

@ibc ibc merged commit 42bc0f7 into v3 Feb 1, 2024
20 checks passed
@ibc ibc deleted the announced_ip_can_be_a_hostname branch February 1, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

announced_ip can also be a hostname (not possible in Rust)
3 participants