Decide session staleness on a monotonic clock in LifecycleWatcher
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 56/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Kotlin
- Stelle
- 1.4k
- Fork
- 483
- Merge medio
- 2g 54m
- PR unite (30g)
- 207
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di getsentry/sentry-java
-
Test the `sentry wizard` Android portForse già presa @antonis l’ha presa 1 giorno fa. ApertaPlatform: Java
getsentry/sentry-java#6797 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Narrow and clean up Android consumer keep rulesForse già presa @runningcode l’ha presa 3 giorni fa. ApertaAndroid Platform: Java
getsentry/sentry-java#6771 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Android Bug Platform: Java Waiting for: Product Owner
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
getsentry/sentry-java#6758 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Android Bug Platform: Java Replays
Difficoltà 3/5 1-2 giorni Idoneità per principianti 62/100
getsentry/sentry-java#6741 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Android Bug Platform: Java Replays
Difficoltà 3/5 1-2 giorni Idoneità per principianti 50/100
getsentry/sentry-java#6740 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di getsentry/sentry-java
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
IacobIonut01/ReFra#1515 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
openwatersio/slackwater-android#162 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 Mezza giornata Idoneità per principianti 72/100
developmentwithyash/yaan#184 ·
I maintainer di solito rispondono entro 1 giorno
-
analytics
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
🐛 Type:Bug 📏 Size: S 🔧 State:In Progress 🔹 Priority: P2 - Medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
yeliqin666/xjtu-toolbox-android#623 · 1 commento ·