Skip to content

fix(upload): Forward-compatible query params#6076

Open
jjbayer wants to merge 12 commits into
masterfrom
ref/location-forward-compat
Open

fix(upload): Forward-compatible query params#6076
jjbayer wants to merge 12 commits into
masterfrom
ref/location-forward-compat

Conversation

@jjbayer

@jjbayer jjbayer commented Jun 10, 2026

Copy link
Copy Markdown
Member

For the sake of forward-compatibility, add an "other" variant to the location query params enum. Instead of denylisting certain keys, like sentry_key, prefix all upload-relevant keys with upload_ such that only those get picked up by the upload service.

Fixes: INGEST-807

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

INGEST-807

Comment on lines +491 to +524
impl<'de> Deserialize<'de> for UploadParams {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
struct UploadParamsVisitor;

impl<'de> serde::de::Visitor<'de> for UploadParamsVisitor {
type Value = UploadParams;

fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str("upload query parameters")
}

fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error>
where
A: serde::de::MapAccess<'de>,
{
let mut upload_params = BTreeMap::new();

while let Some(key) = map.next_key::<&str>()? {
if key.starts_with("upload_") {
upload_params.insert(key.to_owned(), map.next_value()?);
} else {
map.next_value::<serde::de::IgnoredAny>()?;
}
}

Ok(UploadParams(upload_params))
}
}

deserializer.deserialize_map(UploadParamsVisitor)
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added this custom parser to skip over query params that do not start with upload_ (e.g. sentry_key).

@jjbayer jjbayer marked this pull request as ready for review June 11, 2026 19:47
@jjbayer jjbayer requested a review from a team as a code owner June 11, 2026 19:47

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 74c2a68. Configure here.

Comment thread relay-server/src/services/upload.rs
Comment thread relay-server/src/services/upload.rs
Comment thread relay-server/src/services/upload.rs
Comment thread relay-server/src/services/upload.rs Outdated
Comment thread relay-conventions/sentry-conventions
jjbayer and others added 3 commits June 12, 2026 09:45
Co-authored-by: Sebastian Zivota <loewenheim@users.noreply.github.com>
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.

2 participants