Skip to content

Conversation

@itaybre
Copy link
Contributor

@itaybre itaybre commented Oct 23, 2025

This PR adds a new method in PrivateSentrySDKOnly for SDKs which use our SDK can add a custom view hierarchy.

Fixes: #6491

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 5300cae

@codecov
Copy link

codecov bot commented Oct 23, 2025

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
3883 2 3881 52
View the top 2 failed test(s) by shortest run time
iOS_SwiftUI_UITests.FeedbackUITests::testWidgetDisplayInSwiftUIApp
Stack Traces | 0s run time
.../iOS-SwiftUI/iOS-SwiftUI-UITests/FeedbackUITests.swift:14 - Failed to get matching snapshots: Timed out while evaluating UI query.
iOS_Swift_UITests.LaunchUITests::testBreadcrumbData
Stack Traces | 0s run time
.../iOS-Swift/iOS-Swift-UITests/BaseUITest.swift:27 - Failed to terminate io.sentry.sample.iOS-Swift:8545: Failed to terminate io.sentry.sample.iOS-Swift:0

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 23, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1222.57 ms 1261.89 ms 39.32 ms
Size 23.75 KiB 1.02 MiB 1016.47 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
ed85746 1231.79 ms 1248.55 ms 16.75 ms
78af7a9 1225.75 ms 1256.98 ms 31.23 ms
e18d392 1228.69 ms 1244.43 ms 15.73 ms
e8da57d 1203.77 ms 1234.85 ms 31.08 ms
c5bedc0 1203.83 ms 1236.17 ms 32.33 ms
52588a5 1226.24 ms 1257.22 ms 30.98 ms
b9ceffb 1222.57 ms 1247.96 ms 25.39 ms
caa7e70 1233.61 ms 1259.13 ms 25.52 ms
b5a7583 1238.22 ms 1263.94 ms 25.71 ms
5c5648e 1234.44 ms 1253.79 ms 19.35 ms

App size

Revision Plain With Sentry Diff
ed85746 23.75 KiB 920.83 KiB 897.08 KiB
78af7a9 23.75 KiB 990.00 KiB 966.26 KiB
e18d392 23.75 KiB 866.68 KiB 842.93 KiB
e8da57d 23.75 KiB 919.69 KiB 895.94 KiB
c5bedc0 23.75 KiB 920.63 KiB 896.89 KiB
52588a5 23.75 KiB 1.00 MiB 1005.07 KiB
b9ceffb 23.75 KiB 969.07 KiB 945.32 KiB
caa7e70 23.75 KiB 1004.68 KiB 980.94 KiB
b5a7583 23.75 KiB 913.44 KiB 889.68 KiB
5c5648e 23.75 KiB 879.60 KiB 855.86 KiB

Previous results on branch: itay/view_hierarchy_downstream_2

Startup times

Revision Plain With Sentry Diff
331866b 1226.74 ms 1261.31 ms 34.57 ms
ada6c87 1191.10 ms 1216.51 ms 25.41 ms

App size

Revision Plain With Sentry Diff
331866b 23.75 KiB 1.00 MiB 1005.94 KiB
ada6c87 23.75 KiB 1.01 MiB 1016.25 KiB

Base automatically changed from itay/enable_private_only_tests to main October 23, 2025 20:53
Copy link
Contributor

@noahsmartin noahsmartin left a comment

Choose a reason for hiding this comment

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

Is it not entirely possible to achieve the same behavior today without adding to this private API? You can call SentrySDK.configureScope { ... } Wouldn't that allow the Godot SDK to do the same thing?

IMO we should try to have fewer hybrid SDK specific APIs, and move towards a version where anything that needs to be visible to an SDK should be part of the public API. So my suggestion is just to double check, do we really need to add an API for this?

@itaybre
Copy link
Contributor Author

itaybre commented Oct 23, 2025

Is it not entirely possible to achieve the same behavior today without adding to this private API? You can call SentrySDK.configureScope { ... } Wouldn't that allow the Godot SDK to do the same thing?

IMO we should try to have fewer hybrid SDK specific APIs, and move towards a version where anything that needs to be visible to an SDK should be part of the public API. So my suggestion is just to double check, do we really need to add an API for this?

The current blocker is SentryAttachment's attachmentType being private only

@noahsmartin
Copy link
Contributor

Makes sense thanks for explaining @itaybre Maybe we should make the attachment type property visible to hybrid SDKs, or visible to everyone? That way the extra logic that would never get called from regular users of the cocoa SDK doesn't have to be included in every native app and can instead be in the Godot repo, seems more scalable/better abstracted that way

@philipphofmann
Copy link
Member

Maybe we should make the attachment type property visible to hybrid SDKs, or visible to everyone?

We didn't decide on this yet, but I think we should come up with proper APIs also for hybrid. This visible only to hybrid only causes problems. We quite often break them. We should treat hybrid as any other SDK user. So IMO we should make the things they need public with a proper API and only change these APIs when doing a major.

@itaybre itaybre changed the title feat: Add view hierarchy attachment support for downstream SDKs feat: Expose attachment type on SentryAttachment Oct 29, 2025
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thanks @itaybre.

Comment on lines +11 to +13
/**
* Attachment Type
*/
Copy link
Member

Choose a reason for hiding this comment

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

m: I think it would make sense to explain a bit what these attachment types are and to explain clearly that the typical user doesn't need to worry about this as mostly HybridSDKs use it. The same applies for the init methods.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose SentryAttachment's attachmentType for Internal SDKs

4 participants