Skip to content

feat(uploads): Restrict attachment type#17229

Open
jjbayer wants to merge 2 commits intomasterfrom
feat/attachmnent-type-upload
Open

feat(uploads): Restrict attachment type#17229
jjbayer wants to merge 2 commits intomasterfrom
feat/attachmnent-type-upload

Conversation

@jjbayer
Copy link
Copy Markdown
Member

@jjbayer jjbayer commented Apr 2, 2026

DESCRIBE YOUR PR

The upload endpoint can only be used for plain attachments, so we should restrict the attachment_type item header.

ref: https://linear.app/getsentry/project/super-sized-attachments-d6ccf1b64c8d

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

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

Project Deployment Actions Updated (UTC)
develop-docs Ready Ready Preview, Comment Apr 2, 2026 8:33am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
sentry-docs Ignored Ignored Preview Apr 2, 2026 8:33am

Request Review

@jjbayer jjbayer marked this pull request as ready for review April 2, 2026 08:26
@jjbayer jjbayer requested review from a team, jpnurmi and tobias-wilfert April 2, 2026 08:27
|-------|------|----------|-------------|
| `type` | String | **REQUIRED** | **MUST** be `"attachment"`. |
| `content_type` | String | **REQUIRED** | **MUST** be `"application/vnd.sentry.attachment-ref+json"`. |
| `attachment_type` | String | **REQUIRED** | **MUST** be `event.attachment` (no special processing). |
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The documentation for attachment placeholders is contradictory. The attachment_type field is marked as REQUIRED in one place but is described as conditional and omitted from an example elsewhere.
Severity: MEDIUM

Suggested Fix

Update the documentation to be consistent. The prose on line 259 should be changed to state that attachment_type is always required. The JSON example on line 391 should be updated to include the "attachment_type":"event.attachment" field to match the specification.

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#L254

Potential issue: The documentation for attachment placeholders in
`develop-docs/sdk/telemetry/attachments.mdx` contains conflicting information regarding
the `attachment_type` field. A newly added table on line 254 specifies that
`attachment_type` is a `REQUIRED` field. However, pre-existing prose on line 259 implies
it is conditional, stating it should be included "if it was set". Furthermore, an
example envelope on line 391 omits the `attachment_type` field entirely. This
contradictory guidance will likely lead to inconsistent SDK implementations, with some
treating the field as required, some as conditional, and others as optional, undermining
protocol compliance.

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

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.

3 participants