feat(playstation): Upload non-prosperodmp attachments#5673
Open
feat(playstation): Upload non-prosperodmp attachments#5673
Conversation
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
commented
Feb 27, 2026
elramen
commented
Mar 2, 2026
jjbayer
reviewed
Mar 2, 2026
There was a problem hiding this comment.
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.
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))
}
}
}There was a problem hiding this comment.
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.
elramen
commented
Mar 6, 2026
jjbayer
requested changes
Mar 9, 2026
Member
jjbayer
left a comment
There was a problem hiding this comment.
Nice work, the AttachmentStrategy pattern cleans the code up nicely.
There's a few things we still need to fix before we can ship this, see comments. I'm happy to pair on the PR to finalize it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.