You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose AddToTransactions flag on derived SentryAttachment types (ViewHierarchyAttachment, ScreenshotAttachment) #5380
As @Flash0ver asked, the derived attachment types don't currently expose this flag — their constructors call base(...) without it, so addToTransactions is always false. There are two subclasses:
ViewHierarchyAttachment — public (core Sentry). Its single ctor takes only IAttachmentContent and hard-codes the base call, so there's no way for a consumer to opt a view-hierarchy attachment into transactions.
ScreenshotAttachment — internal (Sentry.Maui.Internal). Not part of the public API, but the flag could still be plumbed internally if we want screenshots addable to transactions.
Proposal
Offer the addToTransactions flag on the derived attachment types too, so it can be set consistently:
Add an overloaded ViewHierarchyAttachment ctor that accepts bool addToTransactions and forwards it to base(...).
Plumb the flag through ScreenshotAttachment internally as needed (no public surface change required since it's internal).
This is additive (a new overload), so it is not a breaking change and doesn't need to wait for a major.
Acceptance criteria
ViewHierarchyAttachment exposes a way to set addToTransactions
ScreenshotAttachment can set addToTransactions where appropriate
Existing (default false) behavior is preserved for callers that don't pass the flag
Activity
linear-code commentedon Jul 13, 2026
NET-738
jamescrosswell commentedon Jul 13, 2026
Superseded — will be addressed directly in #5182 rather than as a follow-up.