getsentry / getsentry/sentry-java

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

未關閉
#5,580 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

Platform: Java
主要語言
Kotlin
星號
1.4k
分支
478
平均合併
3 天 4 小時
30 天內合併 PR
72

描述

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

閱讀 sentry/src/main/java/io/sentry/Session.java,特別查看第 227 行附近的 session 更新路徑、第 240 行附近的 calculateDurationTime,以及第 309 行附近的 getSequenceTimestamp。追蹤時鐘變更如何影響 sequence 排序與 duration 處理,然後找出相關的現有測試或測試入口。完成的標準是:在處理報告中的 clock-step 情況時,不會遺失較新的 session state,也不會掩蓋負 duration。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
observability
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。