HeartbeatPlugin ignores heartbeat intervals with a seconds component under 30 (uses TimeSpan.Seconds instead of TotalSeconds)
維護者通常 6 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
閱讀 src/Exceptionless/Plugins/Default/100_HeartbeatPlugin.cs,尤其是第 16–18 行的間隔驗證;issue 指出錯誤的 TimeSpan.Seconds 檢查,並建議比較總秒數或一個 TimeSpan。檢查 src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs 中 UseSessions 的傳遞,並新增或尋找一個針對小於和大於 30 秒間隔的測試。完成標準是保留 30 秒或更長的間隔,而較短的間隔使用一分鐘的預設值。
由索引模型根據 Issue 內容生成。
描述
In Exceptionless 6.2.0 (core Exceptionless package), HeartbeatPlugin validates the configured interval with interval.Value.Seconds >= 30. TimeSpan.Seconds is only the 0-59 seconds component, so most whole-minute intervals are rejected and silently replaced with the 1 minute default.
Where
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Plugins/Default/100_HeartbeatPlugin.cs#L16-L18
- https://github.com/exceptionless/Exceptionless.Net/blob/5792f00d175f94a35fe0559c8e9999234a8163be/src/Exceptionless/Extensions/ExceptionlessConfigurationExtensions.cs#L111-L121 (
UseSessions(heartbeatInterval: ...)passes the value through)
What happens
| Requested interval | .Seconds |
Interval used |
|---|---|---|
TimeSpan.FromSeconds(45) |
45 | 45 seconds |
TimeSpan.FromSeconds(90) |
30 | 90 seconds |
TimeSpan.FromSeconds(75) |
15 | 1 minute |
TimeSpan.FromMinutes(2) |
0 | 1 minute |
TimeSpan.FromMinutes(5) |
0 | 1 minute |
Any interval that is a whole number of minutes falls back to 1 minute, so config.UseSessions(heartbeatInterval: TimeSpan.FromMinutes(5)) sends heartbeats every minute instead of every 5 minutes.
Expected
Intervals of 30 seconds or more are honored; only intervals under 30 seconds fall back to the default.
With the 6.2.0 package, new HeartbeatPlugin(TimeSpan.FromMinutes(5)) stores an interval of 00:01:00, while new HeartbeatPlugin(TimeSpan.FromSeconds(90)) stores 00:01:30.
Steps to reproduce
config.UseSessions(heartbeatInterval: TimeSpan.FromMinutes(5));- Set a user identity and submit an event to start a session.
- Session heartbeat events are sent every minute, not every 5 minutes.
Suggested fix
Use interval.Value.TotalSeconds >= 30 (or interval.Value >= TimeSpan.FromSeconds(30)).
- 主要語言
- C#
- 星號
- 573
- 分支
- 143
- 平均合併
- 5 天 9 小時
- 30 天內合併 PR
- 1
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
exceptionless/Exceptionless.Net 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 86/100
exceptionless/Exceptionless.Net#391 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
exceptionless/Exceptionless.Net#390 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 76/100
exceptionless/Exceptionless.Net#386 ·
維護者通常 6 天內回覆
-
bug
難度 2/5 1-3 小時 新手友好度 35/100
exceptionless/Exceptionless.Net#389 ·
維護者通常 6 天內回覆
-
bug
難度 3/5 1-2 天 新手友好度 72/100
exceptionless/Exceptionless.Net#388 ·
維護者通常 6 天內回覆
查看 exceptionless/Exceptionless.Net 的全部 Issue
相似的 Issue
-
bug effort:S P3
難度 2/5 1-3 小時 新手友好度 85/100
nightscout/nocturne#3093 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 67/100
維護者通常 3 天內回覆
-
難度 1/5 1 小時以內 新手友好度 85/100
-
難度 2/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100