Skip to content

feat(attachments): Redirect Objectstore-backed attachment downloads to Objectstore - #120958

Draft
jan-auer wants to merge 1 commit into
masterfrom
feat/attachment-download-redirect
Draft

feat(attachments): Redirect Objectstore-backed attachment downloads to Objectstore#120958
jan-auer wants to merge 1 commit into
masterfrom
feat/attachment-download-redirect

Conversation

@jan-auer

Copy link
Copy Markdown
Member

Attachment downloads (GET .../attachments/<id>/?download=1) now return a 302 for attachments stored in Objectstore, so the payload no longer travels through Sentry. Internal callers are redirected straight to Objectstore; external callers go through the locality's Objectstore proxy, which continues to negotiate Accept-Encoding and decompress for clients that don't accept zstd. Inline and legacy filestore (eventattachments/v1/) attachments are unchanged and still stream.

This applies to every Objectstore-backed attachment with no feature flag, reusing the get_download_redirect_url helper that ProjectDebugFile already uses.

Known regression: Objectstore only sends Content-Disposition when the object was stored with filename metadata, and none of the attachment write paths (EventAttachment.putfile, Relay, reprocessing2) set it today. Downloads will therefore be named after the storage key instead of the attachment name. Fixing it requires the write paths to pass a sanitized filename — attachment names are SDK-controlled and cannot go into an HTTP header unescaped — and would only help newly stored objects, so it is left as follow-up.

Refs FS-466

@jan-auer
jan-auer requested review from a team as code owners July 31, 2026 09:02
@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

FS-466

@lcian lcian left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me.

@jan-auer
jan-auer marked this pull request as draft July 31, 2026 10:40
@jan-auer

Copy link
Copy Markdown
Member Author

Waiting with the rollout until Produces have been updated for at least a week to cover most attachments:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants