Skip to content

Session crash detection skipped for manually started sessions #5108

@tustanivsky

Description

@tustanivsky

Integration

sentry-android

Build System

Gradle

AGP Version

6.1.0

Proguard

Enabled

Version

8.33.0

Steps to Reproduce

When enableAutoSessionTracking is set to false and a session is started manually via Sentry.startSession(), crashed sessions are never marked as crashed. As a result, crash-free metrics always show 100% despite confirmed crashes.

Apparently PreviousSessionFinalizer.run() bails out early when isEnableAutoSessionTracking() returns false which means a manually started session that ends in a crash is never finalized on the next app launch and the previous session file on disk is simply ignored:

if (!options.isEnableAutoSessionTracking()) {
options
.getLogger()
.log(DEBUG, "Session tracking is disabled, bailing from previous session finalizer.");
return;
}

Originally this issue was reported in the Unreal SDK: getsentry/sentry-unreal#1204 (comment)

Expected Result

Crash free session rate display valid value.

Actual Result

Crash free session rate is always 100%

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    Waiting for: Product Owner

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions