Skip to content

Fix opening partitions from redap origins with port 443 or 80 #9511

New issue

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

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

Already on GitHub? # to your account

Merged
merged 4 commits into from
Apr 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/utils/re_uri/src/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ impl Origin {
// `Origin` in that case.
let mut http_url = url::Url::parse(&rewritten)?;

if http_url.port().is_none() {
// If we parse a Url from e.g. `https://redap.rerun.io:443`, `port` in the Url struct will
// be `None`. So we need to use `port_or_known_default` to get the port back.
// See also: https://github.com/servo/rust-url/issues/957
if http_url.port_or_known_default().is_none() {
Copy link
Member

Choose a reason for hiding this comment

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

Well this is very annoying. This means the default port logic doesn't work.

We talked this through in a huddle, and decided we'll leave it as a TODO until servo/rust-url#957 is fixed

// If no port is specified, we assume the default redap port:
http_url.set_port(Some(51234)).ok();
}
Expand Down
4 changes: 4 additions & 0 deletions crates/utils/re_uri/src/redap_uri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,10 @@ mod tests {
}

#[test]
#[ignore]
// TODO(lucasmerlin): This should ideally work but doesn't right now because of a issue in the `url` crate:
// https://github.com/servo/rust-url/issues/957
// See also `replace_and_parse` in `origin.rs`
fn test_default_port() {
let url = "rerun://localhost";

Expand Down
22 changes: 13 additions & 9 deletions crates/viewer/re_redap_browser/src/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ impl Server {
response
});

ui.list_item().header().show_hierarchical_with_children(
ui,
egui::Id::new(&self.origin).with("server_item"),
true,
content,
|ui| {
self.entries.panel_ui(viewer_context, ctx, ui, recordings);
},
);
ui.list_item()
.header()
.show_hierarchical_with_children(
ui,
egui::Id::new(&self.origin).with("server_item"),
true,
content,
|ui| {
self.entries.panel_ui(viewer_context, ctx, ui, recordings);
},
)
.item_response
.on_hover_text(self.origin.to_string());
}
}

Expand Down