getsentry / getsentry/sentry-java

Session seq is raw epoch millis; duration is masked with Math.abs

Abierto
#5,580 1 comentario 0 reacciones 0 asignados Ver en GitHub
Platform: Java
Lenguaje dominante
Kotlin
Estrellas
1.4k
Forks
478
Merge medio
2 d 23 h
PR fusionados (30 d)
67

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
java
Área
observability
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.