Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- The SDK now logs a `Warning` instead of an `Error` when being ratelimited ([#4927](https://github.com/getsentry/sentry-dotnet/pull/4927))
- libmonosgen and libxamarin frames no longer show as inapp ([#4960](https://github.com/getsentry/sentry-dotnet/pull/4960))

## 6.2.0-alpha.0

Expand Down
8 changes: 8 additions & 0 deletions src/Sentry/SentryOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1904,6 +1904,14 @@ internal static List<StringOrRegex> GetDefaultInAppExclude() =>
"Grpc",
"ServiceStack",
"Java.Interop",
// (^|[/\\]) — anchors to start of string or after a forward/backward slash
// ([^/\\]*libmonosgen[^/\\]*) — last segment contains libxamarin (no slashes before/after)
// $ — end of string
new Regex(@"(^|[/\\])([^/\\]*libmonosgen[^/\\]*)$"),
// (^|[/\\]) — anchors to start of string or after a forward/backward slash
// ([^/\\]*libxamarin[^/\\]*) — last segment contains libxamarin (no slashes before/after)
// $ — end of string
new Regex(@"(^|[/\\])([^/\\]*libxamarin[^/\\]*)$")
];

/// <summary>
Expand Down
40 changes: 40 additions & 0 deletions test/Sentry.Tests/Protocol/Exceptions/SentryStackFrameTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,46 @@ public void ConfigureAppFrame_WithDefaultOptions_NotBuiltInIgnoredMarkedAsInApp(
Assert.True(sut.InApp);
}

[Theory]
[InlineData("foolibmonosgenbar", false)]
[InlineData("/data/Containers/Bundle/Application/Example.app/libmonosgen-dotnet-release.dylib", false)]
[InlineData("/data/libmonosgen/something-else.dylib ", true)]
public void ConfigureAppFrame_WithDefaultOptions_ExcludesMonoFrames(string package, bool expectedInApp)
{
var options = new SentryOptions();
var sut = new SentryStackFrame
{
Function = "async void MainActivity.OnCreate(Bundle savedInstanceState)+(?) =\\u003E { }",
Package = package
};

// Act
sut.ConfigureAppFrame(options);

// Assert
Assert.Equal(sut.InApp, expectedInApp);
}

[Theory]
[InlineData("foolibxamarinbar", false)]
[InlineData("/data/Containers/Bundle/Application/Example.app/libxamarin-dotnet-release.dylib", false)]
[InlineData("/data/libxamarin/something-else.dylib ", true)]
public void ConfigureAppFrame_WithDefaultOptions_ExcludesXamarinFrames(string package, bool expectedInApp)
{
var options = new SentryOptions();
var sut = new SentryStackFrame
{
Function = "async void MainActivity.OnCreate(Bundle savedInstanceState)+(?) =\\u003E { }",
Package = package
};

// Act
sut.ConfigureAppFrame(options);

// Assert
Assert.Equal(sut.InApp, expectedInApp);
}

[Fact]
public void ConfigureAppFrame_WithDefaultOptions_JavaPackageNotInApp()
{
Expand Down
Loading