Skip to content

docs: Update attachment header requirements in documentation#17040

Merged
tobias-wilfert merged 2 commits intomasterfrom
tobias-wilfert-patch-1
Mar 19, 2026
Merged

docs: Update attachment header requirements in documentation#17040
tobias-wilfert merged 2 commits intomasterfrom
tobias-wilfert-patch-1

Conversation

@tobias-wilfert
Copy link
Member

While implementing this in Relay noticed that ChunkedAttachment has a attachment_type field which we want to set with the original file's attachment type.

While implementing this in Relay noticed that `ChunkedAttachment` has a `attachment_type` field which we want to set with the original file's attachment type.
@tobias-wilfert tobias-wilfert requested review from a team and jjbayer March 19, 2026 13:44
@tobias-wilfert tobias-wilfert self-assigned this Mar 19, 2026
@vercel
Copy link

vercel bot commented Mar 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Mar 19, 2026 2:26pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Preview Mar 19, 2026 2:26pm

Request Review

Co-authored-by: Joris Bayer <joris.bayer@sentry.io>
| `filename` | String | **REQUIRED** | The name of the uploaded file without a path component. |

The item header **MAY** also contain `attachment_type` and the original file's `content_type` as an additional field (see [Standard Attachment Item](#standard-attachment-item)).
The item header **MUST** also contain the original file's `attachment_type` if it was set. The item payload **MUST** contain the original file's `content_type` as a field in the JSON object (see [Standard Attachment Item](#standard-attachment-item)).
Copy link

Choose a reason for hiding this comment

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

Bug: The documentation introduces contradictions. Prose requires attachment_type in the header and content_type in the payload, but the corresponding tables and examples mark them as missing or optional.
Severity: MEDIUM

Suggested Fix

Update the documentation to be consistent. Either modify the prose to align with the tables and examples, or update the tables and examples to reflect the MUST requirements for attachment_type in the item header and content_type in the item payload. For example, add attachment_type to the item headers table and change content_type in the payload table from OPTIONAL to REQUIRED.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: develop-docs/sdk/telemetry/attachments.mdx#L258

Potential issue: The documentation change introduces two contradictions that will likely
cause interoperability issues between different SDK and Relay implementations. First,
the prose at line 258 states the item header `MUST` contain `attachment_type` if set,
but the corresponding item header table and the provided example omit this field.
Second, the prose states the item payload `MUST` contain `content_type`, but the payload
field table marks this field as `OPTIONAL`. These inconsistencies will lead to divergent
implementations, potentially causing problems with how attachments are processed.

Did we get this right? 👍 / 👎 to inform future reviews.

| `filename` | String | **REQUIRED** | The name of the uploaded file without a path component. |

The item header **MAY** also contain `attachment_type` and the original file's `content_type` as an additional field (see [Standard Attachment Item](#standard-attachment-item)).
The item header **MUST** also contain the original file's `attachment_type` if it was set. The item payload **MUST** contain the original file's `content_type` as a field in the JSON object (see [Standard Attachment Item](#standard-attachment-item)).
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this will make sentry bot happy:

Suggested change
The item header **MUST** also contain the original file's `attachment_type` if it was set. The item payload **MUST** contain the original file's `content_type` as a field in the JSON object (see [Standard Attachment Item](#standard-attachment-item)).
The item header **MUST** also contain the original file's `attachment_type` if it was set. The item payload **MUST** contain the original file's `content_type` as a field in the JSON object if it was set (see [Standard Attachment Item](#standard-attachment-item)).

@tobias-wilfert tobias-wilfert merged commit 73f2232 into master Mar 19, 2026
18 checks passed
@tobias-wilfert tobias-wilfert deleted the tobias-wilfert-patch-1 branch March 19, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sdk-develop-docs PRs touching develop-docs/sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants