Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow regular expressions in the InAppIncludes and InAppExcludes #3158

Closed
jamescrosswell opened this issue Feb 19, 2024 · 0 comments · Fixed by #3321
Closed

Allow regular expressions in the InAppIncludes and InAppExcludes #3158

jamescrosswell opened this issue Feb 19, 2024 · 0 comments · Fixed by #3321
Assignees
Labels
Feature New feature or request

Comments

@jamescrosswell
Copy link
Collaborator

jamescrosswell commented Feb 19, 2024

Problem Statement

One of our customers wants to be able to simply add their own namespace as an include and exclude everything else (see Discord thread).

Currently this doesn't work as the logic to determine whether a frame is InApp or not is:

InApp = options.InAppInclude?.Any(resolver) == true || options.InAppExclude?.Any(resolver) != true;

So if you don't have any excludes configured or if the namespace doesn't match one of more of the prefixes configured as an exclude then frame is determined as InApp. This seems way too greedy. That means if you have no includes configured but you have these excludes configured:

- Foo
- Bar

Then the namespace Bar will be considered InApp (because it doesn't match Foo). Given there's an explicit exclude configured for Bar, this seems counter-intuitive. I think there's a bug in this logic then.

The logic should instead be "If it matches any of the Includes and it doesn't match any of the excludes, then it's InApp".

Solution Brainstorm

If SentryOptions.InAppInclude and SentryOptions.InAppExclude were lists of SubstringOrRegex rather than just lists of prefixes, it would be possible to configure an Exclude of .*... which would enable the customer to do what they want.

We also need to fix the logic for matching exclusions from "doesn't match any single exclusion" to "doesn't match any exclusion".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants