sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Add managed attachments to native events

Open TimBurik opened this issue 6 months ago • 6 comments

Package

Sentry

.NET Flavor

.NET

.NET Version

8.0.303

OS

Android

SDK Version

4.10.1

Self-Hosted Sentry Version

No response

Steps to Reproduce

  1. Create an Android app and install Sentry NuGet package;
  2. Configure Sentry so that reported events should have attachments (both logcat and custom attachments are affected by the issue):
SentrySdk.Init(options =>
{
    options.Dsn = "...";
    options.Android.LogCatIntegration = LogCatIntegrationType.All;
});
SentrySdk.ConfigureScope(scope =>
{
    scope.AddAttachment("path/to/existing/file.txt", AttachmentType.Default, MediaTypeNames.Text.Plain);
});
  1. Generate crashes using SentrySdk.CauseCrash() with different parameters

Expected Result

All reported events should have logcat.log attachment with logcat logs and custom file.txt file attachment.

Actual Result

  • Crash generated with parameter CrashType.Native is reported with mechanism signalhandler and contains no attachments;
  • Crash generated with parameter CrashType.JavaBackgroundThread is reported twice: one with mechanism UncaughtExceptionHandler and contains no attachments, and another with mechanism AppDomain.UnhandledException and contains both attachments;
  • All other crash types (CrashType.Managed, CrashType.ManagedBackgroundThread, CrashType.Java) are reported with mechanism AppDomain.UnhandledException and contain both attachments.

This issue might be related to #3461

Reproduction sample: SampleProject.zip

TimBurik avatar Aug 20 '24 13:08 TimBurik