Skip to content

Conversation

@tustanivsky
Copy link
Collaborator

@tustanivsky tustanivsky commented Nov 11, 2025

📜 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.

Closes #6753

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

❌ Patch coverage is 13.33333% with 13 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@8447671). Learn more about missing BASE report.
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...ift/Integrations/UserFeedback/SentryFeedback.swift 16.666% 10 Missing ⚠️
...UserFeedback/SentryUserFeedbackFormViewModel.swift 0.000% 3 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##             main     #6752   +/-   ##
========================================
  Coverage        ?   85.613%           
========================================
  Files           ?       453           
  Lines           ?     27692           
  Branches        ?     12147           
========================================
  Hits            ?     23708           
  Misses          ?      3939           
  Partials        ?        45           
Files with missing lines Coverage Δ
...UserFeedback/SentryUserFeedbackFormViewModel.swift 84.384% <0.000%> (ø)
...ift/Integrations/UserFeedback/SentryFeedback.swift 59.183% <16.666%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8447671...653ed44. Read the comment docs.

@tustanivsky tustanivsky added the ready-to-merge Use this label to trigger all PR workflows label Nov 11, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Nov 11, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1230.00 ms 1262.05 ms 32.05 ms
Size 24.14 KiB 1.01 MiB 1011.55 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ad964ca 1234.73 ms 1254.88 ms 20.15 ms
e16fd46 1228.64 ms 1251.57 ms 22.93 ms
c8dd5e4 1217.67 ms 1242.90 ms 25.23 ms
6d0b605 1218.58 ms 1251.06 ms 32.48 ms
f747c9c 1237.90 ms 1264.77 ms 26.87 ms
2691350 1224.92 ms 1255.82 ms 30.90 ms
fc05805 1220.63 ms 1252.16 ms 31.54 ms
d83b35a 1212.48 ms 1237.02 ms 24.54 ms
d157d83 1228.02 ms 1252.47 ms 24.45 ms
1fecbb8 1242.78 ms 1265.40 ms 22.62 ms

App size

Revision Plain With Sentry Diff
ad964ca 23.75 KiB 913.17 KiB 889.42 KiB
e16fd46 23.74 KiB 1.01 MiB 1008.95 KiB
c8dd5e4 23.75 KiB 913.48 KiB 889.72 KiB
6d0b605 23.75 KiB 1023.82 KiB 1000.07 KiB
f747c9c 23.75 KiB 995.60 KiB 971.85 KiB
2691350 23.75 KiB 850.73 KiB 826.98 KiB
fc05805 23.75 KiB 908.02 KiB 884.27 KiB
d83b35a 23.75 KiB 913.17 KiB 889.42 KiB
d157d83 23.75 KiB 928.85 KiB 905.10 KiB
1fecbb8 23.75 KiB 969.28 KiB 945.53 KiB

Previous results on branch: fix/feedback-attachments

Startup times

Revision Plain With Sentry Diff
458b1de 1234.70 ms 1270.40 ms 35.70 ms
982084f 1222.33 ms 1250.73 ms 28.40 ms

App size

Revision Plain With Sentry Diff
458b1de 24.14 KiB 1.01 MiB 1015.55 KiB
982084f 24.14 KiB 1.01 MiB 1015.55 KiB

Copy link
Contributor

@itaybre itaybre left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM

@philprime philprime enabled auto-merge (squash) November 12, 2025 12:42
@philprime philprime merged commit f41cbcd into main Nov 12, 2025
235 of 245 checks passed
@philprime philprime deleted the fix/feedback-attachments branch November 12, 2025 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-merge Use this label to trigger all PR workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: Multiple attachments support for feedback

4 participants