getsentry / getsentry/sentry-java

Add `doNotEndWithSession` public API for replays

Đang mở
#4,794 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Android Feature Replays
Ngôn ngữ chính
Kotlin
Star
1.4k
Fork
478
Merge trung bình
2 ngày 23 giờ
Pull request đã merge (30 ngày)
67

Mô tả

### Description

Currently, the replay lifecycle is the same one as we have for session health. Citing our [docs](https://docs.sentry.io/platforms/android/session-replay/#user-session):

> A user session starts when the Sentry SDK is initialized or when the application enters the foreground. The session will capture screen transitions, navigations, touches and other events until the application is sent to the background. If the application is brought back to the foreground within 30 seconds (default), the same replay_id will be used and the session will continue.

> The session will be terminated if the application has spent in the background more than 30 seconds or when the maximum duration of 60 minutes is reached. You can adjust the [session tracking interval](https://docs.sentry.io/platforms/android/configuration/releases/#sessions) to extend or shorten the duration of a single replay, depending on your needs.

However, this might not be always suitable, for example, when there's a webview/chrome custom tab is involved in a user session (auth screen). A user can spend more than the default 30 seconds there, which would result in an abrupt session and would not reflect the real flow. We could potentially circumvent this by either:
- Adding a new public API that says `replay().doNotEndWithSession()` (name TBD) that will prevent replay termination when this API is called.
- Or having an option in SentryOptions that would decouple replays and sessions lifecycle
- ... (other ideas here)

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.