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

Fix: Pass maxBreadcrumbs config. to sentry-native #1425

Merged
merged 2 commits into from
Apr 19, 2021
Merged
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 @@ -6,6 +6,7 @@
* Fix: set correct transaction status for unhandled exceptions in SentryTracingFilter (#1406)
* Fix: handle network errors in SentrySpanClientHttpRequestInterceptor (#1407)
* Fix: set scope on transaction (#1409)
* Fix: Pass maxBreadcrumbs config. to sentry-native (#1425)

# 4.4.0-alpha.2

Expand Down
4 changes: 4 additions & 0 deletions sentry-android-ndk/src/main/jni/sentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ Java_io_sentry_android_ndk_SentryNdk_initSentryNative(
jmethodID environment_mid = (*env)->GetMethodID(env, options_cls, "getEnvironment",
"()Ljava/lang/String;");
jmethodID dist_mid = (*env)->GetMethodID(env, options_cls, "getDist", "()Ljava/lang/String;");
jmethodID max_crumbs_mid = (*env)->GetMethodID(env, options_cls, "getMaxBreadcrumbs", "()I");

jstring outbox_path_j = (jstring) (*env)->CallObjectMethod(env, sentry_sdk_options,
outbox_path_mid);
Expand All @@ -202,6 +203,7 @@ Java_io_sentry_android_ndk_SentryNdk_initSentryNative(
jstring environment = (jstring) (*env)->CallObjectMethod(env, sentry_sdk_options,
environment_mid);
jstring dist = (jstring) (*env)->CallObjectMethod(env, sentry_sdk_options, dist_mid);
jint max_crumbs = (jint) (*env)->CallIntMethod(env, sentry_sdk_options, max_crumbs_mid);

ENSURE(outbox_path_j);
const char *outbox_path_str = (*env)->GetStringUTFChars(env, outbox_path_j, 0);
Expand Down Expand Up @@ -229,6 +231,8 @@ Java_io_sentry_android_ndk_SentryNdk_initSentryNative(

sentry_options_set_transport(options, transport);
sentry_options_set_debug(options, debug);
sentry_options_set_max_breadcrumbs(options, max_crumbs);

const char *dsn_str = (*env)->GetStringUTFChars(env, dsn, 0);
sentry_options_set_dsn(options, dsn_str);
(*env)->ReleaseStringUTFChars(env, dsn, dsn_str);
Expand Down