Session Replay: session segment ID can repeat after an error converts buffer mode
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.4k
- Fork
- 483
- Merge trung bình
- 2 ngày 54 phút
- Pull request đã merge (30 ngày)
- 207
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getsentry/sentry-java
-
Test the `sentry wizard` Android portCó thể đã có người làm @antonis đã nhận 1 ngày trước. Đang mởPlatform: Java
getsentry/sentry-java#6797 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Narrow and clean up Android consumer keep rulesCó thể đã có người làm @runningcode đã nhận 3 ngày trước. Đang mởAndroid Platform: Java
getsentry/sentry-java#6771 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Waiting for: Product Owner
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
getsentry/sentry-java#6758 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Bug Platform: Java Replays
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
getsentry/sentry-java#6741 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Android Feature Platform: Java Waiting for: Product Owner
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
getsentry/sentry-java#6731 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của getsentry/sentry-java
Issue tương tự
-
[BUG] Issue reported from ReFraĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
IacobIonut01/ReFra#1515 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
openwatersio/slackwater-android#162 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 72/100
developmentwithyash/yaan#184 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
analytics
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 bình luận ·