Skip to content

Conversation

@jjbayer
Copy link
Member

@jjbayer jjbayer commented Dec 19, 2025

Serialize attachment IDs without hyphens. This is the Sentry way, and aligns better with Event IDs and Trace IDs.

This also means that objectstore keys are now hyphen-free, which would be a breaking change if this wasn't an experimental feature.

@jjbayer jjbayer changed the title Attach/no hyphens fix(attachments): Serialize ID without hyphens Dec 19, 2025
}

#[derive(Clone, Default, PartialEq, Empty, FromValue, ProcessValue)]
pub struct AttachmentId(Uuid);
Copy link
Member Author

Choose a reason for hiding this comment

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

This was largely copied from TraceId.

return {
"trace_id": uuid.uuid4().hex,
"attachment_id": str(uuid.uuid4()),
"attachment_id": uuid.uuid4().hex,
Copy link
Member Author

Choose a reason for hiding this comment

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

The input doesn't need to be hyphen-free, but it makes comparisons with the output easier.

pytest.param(
{"meta_length": None},
273,
269,
Copy link
Member Author

Choose a reason for hiding this comment

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

No more hyphens -> saved some chars.

def create_attachment_envelope(project_config):
return Envelope(
headers={
"event_id": "515539018c9b4260a6f999572f1661ee",
Copy link
Member Author

Choose a reason for hiding this comment

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

Drive-by fix: trace attachment envelopes should not have an event ID.

@jjbayer jjbayer marked this pull request as ready for review December 19, 2025 13:04
@jjbayer jjbayer requested a review from a team as a code owner December 19, 2025 13:04
Comment on lines 336 to 342
let key = Uuid::from_slice(&trace_item.trace_item.item_id)
.map_err(Error::from)
.reject(&trace_item)?
.as_simple()
.to_string();

#[cfg(debug_assertions)]

This comment was marked as outdated.

@jjbayer jjbayer enabled auto-merge January 8, 2026 12:02
@jjbayer jjbayer added this pull request to the merge queue Jan 8, 2026
Merged via the queue into master with commit 3b3adb3 Jan 8, 2026
29 checks passed
@jjbayer jjbayer deleted the attach/no-hyphens branch January 8, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants