Skip to content

feat(playstation): Upload non-prosperodmp attachments#5673

Merged
elramen merged 28 commits intomasterfrom
playstation
Mar 13, 2026
Merged

feat(playstation): Upload non-prosperodmp attachments#5673
elramen merged 28 commits intomasterfrom
playstation

Conversation

@elramen
Copy link
Member

@elramen elramen commented Feb 27, 2026

Stream non-prosperodmp attachments from the playstation endpoint to objectstore instead of adding them to envelope items. By not reading attachments into memory, they are not limited to max_attachment_size, allowing customers to send large memory dumps to the playstation endpoint.

Stream non-prosperodmp attachments to objectstore instead of adding them to the envelope. By not reading attachments into memory, they are not limited to max_attachment_size, allowing customers to send large attachments such as memory dumps to the playstation endpoint.
@elramen elramen requested a review from a team as a code owner February 27, 2026 17:44
@elramen elramen requested a review from jjbayer March 2, 2026 12:33
Copy link

@cursor cursor bot left a comment

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 2 potential issues.

Autofix Details

Bugbot Autofix prepared fixes for both issues found in the latest run.

  • ✅ Fixed: Upload failure silently drops attachment causing data loss
    • Upload, send, or location-conversion failures in Playstation attachment handling now return an error instead of silently dropping the attachment.
  • ✅ Fixed: Redundant duplicate call to infer_attachment_type
    • The strategy now reads the attachment type from the pre-populated item metadata rather than re-inferring it from the multipart field.

Create PR

Or push these changes by commenting:

@cursor push 8d2b144531
Preview (8d2b144531)
diff --git a/relay-server/src/endpoints/playstation.rs b/relay-server/src/endpoints/playstation.rs
--- a/relay-server/src/endpoints/playstation.rs
+++ b/relay-server/src/endpoints/playstation.rs
@@ -1,12 +1,12 @@
 use std::io;
 
-use axum::RequestExt;
 use axum::extract::{DefaultBodyLimit, Request};
 use axum::response::IntoResponse;
-use axum::routing::{MethodRouter, post};
+use axum::routing::{post, MethodRouter};
+use axum::RequestExt;
 use bytes::Bytes;
+use futures::stream::BoxStream;
 use futures::TryStreamExt;
-use futures::stream::BoxStream;
 use multer::Field;
 use relay_config::Config;
 use relay_dynamic_config::Feature;
@@ -77,7 +77,7 @@
         field: Field<'static>,
         mut item: Item,
     ) -> Result<Option<Item>, multer::Error> {
-        let attachment_type = infer_attachment_type(&field);
+        let attachment_type = item.attachment_type().unwrap_or_default();
         match attachment_type {
             AttachmentType::Prosperodump => {
                 let emit_outcome = |outcome, quantity| {
@@ -108,16 +108,19 @@
                     scoping: self.scoping,
                     stream,
                 };
-                let result = self.state.upload().send(stream).await;
-                if let Ok(Ok(location)) = result
-                    && let Ok(location) = location.into_header_value()
-                {
-                    let location = location.as_bytes().to_owned();
-                    item.set_payload(ContentType::AttachmentRef, location);
-                    Ok(Some(item))
-                } else {
-                    Ok(None)
-                }
+                let location = self
+                    .state
+                    .upload()
+                    .send(stream)
+                    .await
+                    .map_err(|_| multer::Error::IncompleteStream)?
+                    .map_err(|_| multer::Error::IncompleteStream)?
+                    .into_header_value()
+                    .map_err(|_| multer::Error::IncompleteStream)?;
+
+                let location = location.as_bytes().to_owned();
+                item.set_payload(ContentType::AttachmentRef, location);
+                Ok(Some(item))
             }
         }
     }
This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

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.

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

Copy link

@cursor cursor bot left a comment

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.

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

Copy link

@cursor cursor bot left a comment

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.

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

Comment on lines +149 to +151
let scoping = project_config
.scoping(meta.public_key())
.ok_or(BadStoreRequest::EventRejected(DiscardReason::ProjectId))?;
Copy link
Member

Choose a reason for hiding this comment

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

As discussed, we should check quotas before starting any uploads, but we can do that in a follow-up PR. See https://linear.app/getsentry/issue/INGEST-808/enforce-quotas-before-uploading.

@elramen elramen requested a review from jjbayer March 12, 2026 15:53
@elramen elramen added this pull request to the merge queue Mar 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
@elramen elramen enabled auto-merge March 13, 2026 10:13
@elramen elramen added this pull request to the merge queue Mar 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 13, 2026
Copy link

@cursor cursor bot left a comment

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.

@elramen elramen enabled auto-merge March 13, 2026 13:54
@elramen elramen added this pull request to the merge queue Mar 13, 2026
Merged via the queue into master with commit 3f24747 Mar 13, 2026
30 checks passed
@elramen elramen deleted the playstation branch March 13, 2026 14:19
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