Skip to content

Commit 6808754

Browse files
authored
Fix url edit warning spam (#11330)
1 parent ecffaab commit 6808754

File tree

4 files changed

+8
-23
lines changed

4 files changed

+8
-23
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8845,7 +8845,6 @@ dependencies = [
88458845
name = "re_uri"
88468846
version = "0.26.0-alpha.1+dev"
88478847
dependencies = [
8848-
"re_log",
88498848
"re_log_types",
88508849
"re_tuid",
88518850
"serde",

crates/utils/re_uri/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ version.workspace = true
1515
workspace = true
1616

1717
[dependencies]
18-
re_log.workspace = true
1918
re_log_types = { workspace = true, features = ["serde"] }
2019
re_tuid.workspace = true
2120

crates/utils/re_uri/src/endpoints/dataset.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl DatasetPartitionUri {
6767
time_range = Some(value.parse::<TimeSelection>()?);
6868
}
6969
_ => {
70-
re_log::warn_once!("Unknown query parameter: {key}={value}");
70+
// We ignore unknown query keys that may be from urls from prior/newer versions.
7171
}
7272
}
7373
}

crates/utils/re_uri/src/fragment.rs

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,12 @@ impl std::str::FromStr for Fragment {
5353
let mut when = None;
5454

5555
for part in split_on_unescaped_ampersand(fragment) {
56+
// If there isn't an equals in this part we skip it as it doesn't contain any data.
5657
if let Some((key, value)) = split_at_first_unescaped_equals(part) {
5758
match key {
5859
"selection" => match value.parse() {
5960
Ok(path) => {
60-
if selection.is_some() {
61-
re_log::warn_once!(
62-
"Multiple paths set in uri #fragment {fragment:?}. Ignoring all but last."
63-
);
64-
}
61+
// If there were selection fragments before this we override them.
6562
selection = Some(path);
6663
}
6764
Err(err) => {
@@ -73,11 +70,7 @@ impl std::str::FromStr for Fragment {
7370
let timeline = TimelineName::from(timeline);
7471
match time.parse::<TimeCell>() {
7572
Ok(time_cell) => {
76-
if when.is_some() {
77-
re_log::warn_once!(
78-
"Multiple times set in uri #fragment {fragment:?}. Ignoring all but last."
79-
);
80-
}
73+
// If there were when fragments before this we ignore them.
8174
when = Some((timeline, time_cell));
8275
}
8376
Err(err) => {
@@ -92,8 +85,6 @@ impl std::str::FromStr for Fragment {
9285
));
9386
}
9487
}
95-
} else {
96-
re_log::warn_once!("Contained a part {part:?} without any equal sign in it");
9788
}
9889
}
9990

@@ -102,15 +93,11 @@ impl std::str::FromStr for Fragment {
10293
}
10394

10495
impl Fragment {
105-
/// Parse fragment, excluding hash
96+
/// Parse fragment, excluding hash.
97+
///
98+
/// Returns `Fragment::default()` if parsing fails.
10699
pub fn parse_forgiving(fragment: &str) -> Self {
107-
match fragment.parse() {
108-
Ok(fragment) => fragment,
109-
Err(err) => {
110-
re_log::warn_once!("Failed to parse #fragment {fragment:?}: {err}");
111-
Self::default()
112-
}
113-
}
100+
fragment.parse().unwrap_or_default()
114101
}
115102

116103
/// True if this fragment doesn't contain any information.

0 commit comments

Comments
 (0)