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
-
难度 2/5 1-3 小时 新手友好度 78/100
-
area: core priority: low type: bug
难度 2/5 1-3 小时 新手友好度 74/100
RicoSuter/Namotion.Interceptor#863 ·
维护者通常 1 天内回复
-
area-cli
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
0.3.0
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复