Skip to content

Attachments duplication #5542

@codelimit

Description

@codelimit

Integration

sentry-android

Build System

Gradle

AGP Version

9.5.1

Proguard

Enabled

Other Error Monitoring Solution

No

Version

8.43.2

Steps to Reproduce

For sentry_samples_android app

  1. Declare native function in io/sentry/samples/android/NativeSample.java
    public static native void captureException();
  2. Implement native function in native-sample.cpp
JNIEXPORT void JNICALL Java_io_sentry_samples_android_NativeSample_captureException(
    JNIEnv *env, jclass cls) {
  sentry_value_t event = sentry_value_new_event();
  sentry_value_t exc = sentry_value_new_exception("Exception", "Error message.");
  sentry_value_set_stacktrace(exc, NULL, 0);
  sentry_event_add_exception(event, exc);
  sentry_capture_event(event);
}
  1. Add button to trigger the method in io/sentry/samples/android/MainActivity.kt:
  item {
    SentryTraced("capture_exception_native") {
      OutlinedButton(
        onClick = {
          NativeSample.captureException();
        },
        modifier = Modifier,
      ) {
        Text("Capture Exception Native", maxLines = 2, overflow = TextOverflow.Ellipsis)
      }
    }
  }
  1. Build and run app, click "Capture Exception Native"
  2. Check event's attachments

Expected Result

Attachments are not duplicated

Actual Result

Attachment duplication:

Image

Metadata

Metadata

Assignees

No one assigned
    No fields configured for issues without a type.

    Projects

    Status
    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions