getsentry / getsentry/sentry-java
Session seq is raw epoch millis; duration is masked with Math.abs
- Lingua principale
- Kotlin
- Stelle
- 1.4k
- Fork
- 478
- Merge medio
- 2g 23h
- PR unite (30g)
- 67
Descrizione
Audit finding **C2 — theoretical, LOW-MEDIUM**.
`Session` uses raw epoch millis for `seq` and `Math.abs` for duration (`sentry/src/main/java/io/sentry/Session.java`):
* `seq` is set from `getSequenceTimestamp()`, which returns `timestamp.getTime()` (raw epoch millis) — `Session.java:309`, invoked from the session-update path at `:227`. A backward clock step between updates → the newer update has a smaller `seq` → the server can discard the latest session state (lost end/error counts).
* `calculateDurationTime` uses `Math.abs``(timestamp.getTime() - started.getTime())` (`Session.java:240`), which masks negative durations rather than surfacing them.
Source: [JAVA-557]() §C2.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Read sentry/src/main/java/io/sentry/Session.java, especially the session-update path around line 227, calculateDurationTime around line 240, and getSequenceTimestamp around line 309. Trace how clock changes affect sequence ordering and duration handling, then identify the relevant existing tests or test entry points. Done means the reported clock-step cases are handled without losing newer session state or masking negative durations.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- observability
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 48/100