getsentry / getsentry/sentry-java
Add `doNotEndWithSession` public API for replays
- 主要語言
- Kotlin
- 星號
- 1.4k
- 分支
- 478
- 平均合併
- 3 天 4 小時
- 30 天內合併 PR
- 72
描述
### 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)
貢獻指南
研究方向
先檢視連結文件中所描述的 Android session replay 生命週期,以及現有的 replay() 和 SentryOptions 進入點。釐清預期結果是 doNotEndWithSession() API,還是將 replay 與 session 生命週期解耦的設定,然後定義針對進入背景以及跨 session interval 時行為的測試。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- android, kotlin
- 領域
- mobile
- Issue 類型
- 功能
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100