Session Replay: session segment ID can repeat after an error converts buffer mode
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 50/100
Piste de recherche
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.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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.
- Langage dominant
- Kotlin
- Étoiles
- 1.4k
- Forks
- 483
- Merge moyen
- 2 j 54 min
- PR mergées (30 j)
- 207
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getsentry/sentry-java
-
Test the `sentry wizard` Android portPeut-être pris @antonis l’a pris il y a 1 jour. OuvertePlatform: Java
getsentry/sentry-java#6797 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Narrow and clean up Android consumer keep rulesPeut-être pris @runningcode l’a pris il y a 3 jours. OuverteAndroid Platform: Java
getsentry/sentry-java#6771 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 1 jour
-
Android Bug Platform: Java Waiting for: Product Owner
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
getsentry/sentry-java#6758 · 4 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Android Bug Platform: Java Replays
Difficulté 3/5 1-2 jours Accessibilité débutants 62/100
getsentry/sentry-java#6741 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Android Feature Platform: Java Waiting for: Product Owner
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
getsentry/sentry-java#6731 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de getsentry/sentry-java
Issues similaires
-
[BUG] Issue reported from ReFraOuverteenhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
IacobIonut01/ReFra#1515 · 1 commentaire ·
Les mainteneurs répondent en général sous 4 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
openwatersio/slackwater-android#162 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 Une demi-journée Accessibilité débutants 72/100
developmentwithyash/yaan#184 ·
Les mainteneurs répondent en général sous 1 jour
-
analytics
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 commentaire ·