Missing upper bound on events_count causes UInt16 overflow
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- postgresql, typescript
调研方向
阅读 packages/core/src/modules/ingest/ingest.constants.ts 中的 events_count 验证器,然后检查 replay 处理程序如何在 packages/core/src/modules/ingest/ingest.service.ts 中传递它,并查看 packages/db/src/code-migrations/10-add-session-replay.ts 中的 ClickHouse 列。为 65,535 和 65,536 添加边界验证测试;完成标准是 65,535 被接受,超过该值的数值在数据库解析之前被拒绝。
由索引模型根据 Issue 内容生成。
描述
Description
While going through the session replay ingestion flow, I noticed that events_count doesn't have an upper bound in zReplayPayload, even though the corresponding ClickHouse column is of type UInt16.
Unlike chunk_index, which already has a .max(65_535) check, events_count accepts integers beyond the database's supported range. The replay handler also forwards this value unchanged.
without .max(65_535)
with .max(65_535')
Steps to reproduce
I reproduced the overflow locally using ClickHouse 26.1.3:
SELECT events_count
FROM format(
JSONEachRow,
'events_count UInt16',
'{"events_count":65536}'
);
Actual result: 0
Expected behaviour: Values exceeding 65,535 should be rejected during request validation rather than silently wrapping around during database parsing.
A control query with 65535 returns the correct value.
Relevant files
packages/core/src/modules/ingest/ingest.constants.tspackages/core/src/modules/ingest/ingest.service.tspackages/db/src/code-migrations/10-add-session-replay.ts
Proposed fix
Add .max(65_535) to the events_count validator, consistent with chunk_index, along with boundary validation tests.
Are replay chunks exceeding 65,535 events intentionally supported? If not, I would be happy to submit a PR for this.
- 主要语言
- TypeScript
- 星标
- 7.3k
- 派生
- 552
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 13
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Openpanel-dev/openpanel 的其他 Issue
-
Bug: Saved reports lose their custom event selection after reload可能已有人在做 @shiv-shi 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
Openpanel-dev/openpanel#694 ·
维护者通常 1 天内回复
-
Free trial banner overlaps the AI Chat sidebar可能已有人在做 @VasuS609 于 2 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 64/100
Openpanel-dev/openpanel#690 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Openpanel-dev/openpanel#653 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 73/100
Openpanel-dev/openpanel#610 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 35/100
Openpanel-dev/openpanel#697 ·
维护者通常 1 天内回复
查看 Openpanel-dev/openpanel 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 86/100
ardia-browser/ardia#6391 ·
维护者通常 1 天内回复
-
Feature:Actions/ConnectorTypes Team:ResponseOps
难度 2/5 1-3 小时 新手友好度 85/100
elastic/kibana#309028 · 1 条评论 ·
维护者通常 1 天内回复
-
🔨 tool 🧰 library
难度 2/5 1-3 小时 新手友好度 68/100
Orange-OpenSource/Orange-Boosted-Bootstrap#4035 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
DISIC/teleservice-conformite#230 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
rothgar/rabble.radio#410 ·
维护者通常 1 天内回复