Skip to content

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

Open
vaind wants to merge 1 commit into
mainfrom
fix/pin-inapp-sdk-internals
Open

fix: Fail loudly when the in-app SDK internals move#144
vaind wants to merge 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 <[email protected]>
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
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.

2 participants