Skip to content

fix: Multiple attachments support for feedback #6753

@github-actions

Description

@github-actions

Note

The pull request "fix: Multiple attachments support for feedback" was created by @tustanivsky but did not reference an issue. Therefore this issue was created for better visibility in external tools like Linear.

📜 Description

Updated SentryFeedback to accept [Attachment] objects instead of raw [Data] arrays, enabling proper support for
multiple attachments with full metadata (filename, content type, etc.).

This also introduces some breaking changes to public API:

  • init method signature
  • dataDictionary() method now returns attachments as [[String: Any]] with metadata instead of [Data] affecting consumers of the onSubmitSuccess callback

This issue originally came up in Unreal SDK while adding attachment support for user feedback:

💡 Motivation and Context

The previous implementation had several limitations:

  1. Hardcoded metadata: attachmentsForEnvelope() assumed all attachments were screenshots and hardcoded filename: "screenshot.png" and contentType: "application/png"
  2. Single attachment limitation: Only the first attachment was processed despite accepting an array
  3. Lost metadata: Converting Attachment → Data → Attachment discarded important information like custom filenames and content types
  4. Backend supports multiple: The Sentry backend can successfully process and display multiple feedback attachments, but the SDK wasn't taking advantage of this

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions