Session Replay: session segment ID can repeat after an error converts buffer mode
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 50/100
調査の方向性
Start in ReplayIntegration.captureCurrentReplay and follow convert() into BufferCaptureStrategy.start; then read the queued replay tasks for pause, configuration_changed, and add_frame that mutate currentSegment. Reproduce with a test where one of those tasks is queued when an error converts the strategy, then assert session segment IDs do not repeat. Done when the next session ID is derived from the segment actually sent via onSegmentSent, not from a stale copy, and the replay test passes.
索引モデルが issue の本文から書いたものです。
説明
Problem
When an error converts buffer mode to session mode, the session can send two segments with the same segment ID.
captureCurrentReplay calls convert() on the caller thread. convert() gives currentSegment to SessionCaptureStrategy.start(segmentId = currentSegment) immediately. But tasks that are still in the queue of the replay executor can change the counter of the buffer strategy after that copy:
pauseandconfiguration_changedadd a buffered segment and docurrentSegment++(also here).add_frameremoves expired buffered segments and doescurrentSegment--.
The capture_replay task then sends the current segment with the changed counter. After that, the callback does activeStrategy.currentSegment++ on the copy that is out of date.
Example
- Buffer mode. No segments are buffered, so
currentSegmentis 0. - The user rotates the device. A
configuration_changedtask is in the queue. - An error occurs before that task runs.
convert()starts the session with segment ID 0. - The
configuration_changedtask buffers segment 0. The buffer counter becomes 1. - The
capture_replaytask sends buffered segment 0 and current segment 1. The callback sets the session counter from 0 to 1. - The next session segment also has ID 1.
Proposed fix
Set the next session segment ID from the ID of the segment that the flush sent (for example, pass it to onSegmentSent and set currentSegment = sentId + 1). Do not increment a copy.
Add a test: a configuration_changed or pause task in the queue when an error converts the strategy. Then the session segment IDs must not repeat.
Found while reviewing #6542. That PR can also change the counter in a queued task (a clock jump deletes buffered segments). The bug is on main without it.
- 主要言語
- Kotlin
- スター
- 1.4k
- フォーク
- 483
- 平均マージ
- 2日 54分
- マージ済み PR(30日)
- 207
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
getsentry/sentry-java のほかの issue
-
Test the `sentry wizard` Android port対応中かも @antonis が 1 日前に担当しました。 オープンPlatform: Java
getsentry/sentry-java#6797 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Narrow and clean up Android consumer keep rules対応中かも @runningcode が 3 日前に担当しました。 オープンAndroid Platform: Java
getsentry/sentry-java#6771 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Platform: Java Waiting for: Product Owner
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
getsentry/sentry-java#6758 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
Android Bug Platform: Java Replays
難易度 3/5 1〜2日 初心者へのやさしさ 62/100
getsentry/sentry-java#6741 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Android Feature Platform: Java Waiting for: Product Owner
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
getsentry/sentry-java#6731 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
getsentry/sentry-java の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
IacobIonut01/ReFra#1515 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
openwatersio/slackwater-android#162 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 半日 初心者へのやさしさ 72/100
developmentwithyash/yaan#184 ·
メンテナーはふだん 1 日以内に返信
-
analytics
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
yeliqin666/xjtu-toolbox-android#623 · コメント 1 件 ·