feat(android): [Unhandled Sessions 4] Add session update API for unsampled hybrid errors by buenaflor · Pull Request #5990 · getsentry/sentry-java · GitHub
Skip to content
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
1 change: 1 addition & 0 deletions sentry-android-core/api/sentry-android-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ public final class io/sentry/android/core/InternalSentrySdk {
public static fun getCurrentScope ()Lio/sentry/IScope;
public static fun serializeScope (Landroid/content/Context;Lio/sentry/android/core/SentryAndroidOptions;Lio/sentry/IScope;)Ljava/util/Map;
public static fun setTrace (Ljava/lang/String;Ljava/lang/String;Ljava/lang/Double;Ljava/lang/Double;)V
public static fun updateSessionForDroppedEventNonTerminating (Z)V
}

public final class io/sentry/android/core/LoadClass : io/sentry/util/LoadClass {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,23 @@ public static SentryId captureEnvelopeNonTerminating(final @NotNull byte[] envel
return scopes.captureEnvelope(envelope);
}

/**
* Session side effects of {@link #captureEnvelopeNonTerminating(byte[])} without sending the
* event. Hybrid SDKs should call this when an error is dropped by sampling.
*
* <p>Do not call this for events dropped by {@code beforeSend} or ignored exception types.
*
* <p>Persisting the session is a blocking disk write on the calling thread, so call this off the
* main thread as the hybrid SDKs do. It is synchronous on purpose: a deferred write would not be
* on disk yet if the process dies right after this returns.
*
* @param crashed {@code true} if the dropped error was unhandled ({@code
* mechanism.handled=false})
*/
public static void updateSessionForDroppedEventNonTerminating(final boolean crashed) {
updateSessionNonTerminating(crashed);
}
Comment thread
buenaflor marked this conversation as resolved.

/**
* Flags the current session for a non-terminating hybrid error and persists it before returning,
* so the marker survives an immediate process death.
Expand Down
Loading