Skip to content

fix: Fail loudly when the in-app SDK internals move - #144

Merged
vaind merged 1 commit into
mainfrom
fix/pin-inapp-sdk-internals
Sep 9, 2026
Merged

fix: Fail loudly when the in-app SDK internals move#144
vaind merged 1 commit into
mainfrom
fix/pin-inapp-sdk-internals

Conversation

@vaind

@vaind vaind commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to @jamescrosswell's review on #143.

Problem

StackTraceProcessor reads SentryOptions.InAppInclude / InAppExclude and the StringOrRegex value fields through reflection. A miss on the properties silently disabled the options; a miss on the fields threw a null-method error on every event.

Approach

  • Resolve all four members once in the constructor with a clear "Failed to find internal member" error. Production warns and ignores the options; under SentryPowershellRethrowErrors (set in tests) it rethrows, matching the context-line handling in the same class.
  • Pin the members by type in tests/sdk-internals.tests.ps1, next to the transport internals. The existing StringOrRegex field check moves there.
  • Lookups now include Public, so the code keeps working if sentry-dotnet makes these members public.

Tested against the bundled 6.10.0. The recent sentry-dotnet change to StringOrRegex (getsentry/sentry-dotnet#5543) only adds IsRegex; the fields are unchanged.

🤖 Generated with Claude Code

StackTraceProcessor read SentryOptions.InAppInclude / InAppExclude and
the StringOrRegex fields via reflection and silently ignored a miss.
Resolve them once, warn (rethrow under SentryPowershellRethrowErrors),
and pin them in sdk-internals.tests.ps1 next to the transport internals.

Follow-up to the review on #143.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread modules/Sentry/private/StackTraceProcessor.ps1 Dismissed
Comment thread tests/sdk-internals.tests.ps1 Dismissed
Comment thread tests/sdk-internals.tests.ps1 Dismissed
@vaind
vaind requested a review from jamescrosswell September 8, 2026 06:02

@jamescrosswell jamescrosswell left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@vaind
vaind merged commit 660eb16 into main Sep 9, 2026
22 checks passed
@vaind
vaind deleted the fix/pin-inapp-sdk-internals branch September 9, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants