Decide session staleness on a monotonic clock in LifecycleWatcher
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 56/100
Piste de recherche
Start with LifecycleWatcher.isSessionOnScopeStale() in sentry-android-core/src/main/java/io/sentry/android/core/LifecycleWatcher.java, then inspect Session and the existing background-path Deadline usage. Check how session start time is stored and serialized; the change is done when the in-memory monotonic start tick supports the staleness decision and is not serialized. The issue points to no specific test, so locate relevant lifecycle and session tests before making the change.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
When the app comes to the foreground with no background window pending, LifecycleWatcher.isSessionOnScopeStale() decides whether to start a new session. This happens when SDK init started the session, rather than the user leaving and coming back. The check compares Session.getStarted() with the wall clock.
A clock step between SDK init and the first foreground gets this wrong:
- A forward step can start a second session when it shouldn't.
- A backward step can keep a stale session.
Release health counts session starts, so either case can move session counts.
Fix
Let a Session remember the monotonic tick it started on. Keep it in memory only and don't serialize it. Then decide staleness with a Deadline, as the background path already does.
Context
getsentry/sentry-java#5580 and getsentry/sentry-java#6585 were closed on 2026-11-18 because Relay ignores the session seq and duration fields. This is the one session clock issue left that affects counts.
Agent notes
sentry-android-core/src/main/java/io/sentry/android/core/LifecycleWatcher.java: seeisSessionOnScopeStale()and itsTODO [MAJOR]on9.x.x(checked 2026-11-18).- Relay at
f218978dbb:relay-server/src/metrics_extraction/sessions/mod.rsbuckets session metrics bystartedand emits only counts.
- 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 Bug Platform: Java Replays
Difficulté 3/5 1-2 jours Accessibilité débutants 50/100
getsentry/sentry-java#6740 · 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 ·