Files
Web_BLS_Heartbeat_Server/openspec/changes/fix-uint64-overflow/tasks.md
XuJiacheng d0c4940e01 feat: 处理整数溢出并持久化无法处理的数据
- 更新 heartbeatProcessor.js 以处理所有数字溢出类型(int16、int32、int64)并使用二进制补码。
- 防止仅与数据相关的 PostgreSQL 失败抛出个别回退错误。
- 在 databaseManager.js 中添加 insertHeartbeatEventsErrors 方法以存储被拒绝的记录。
- 更新 heartbeatProcessor.js 中的 _emitRejectedRecord 方法,直接将所有无法处理的心跳数据写入 heartbeat_events_errors 数据库。
- 更新 openspec 规范以支持新的溢出和验证回退状态。
- 添加测试文件以验证大整数处理。
2026-03-02 10:49:02 +08:00

634 B

1. Implementation

  • 1.1 Update heartbeatProcessor.js to handle all numeric overflow types (int16, int32, int64) with two's complement.
  • 1.2 Prevent purely data-related Postgres failures from throwing away individual fallbacks within databaseManager.js.
  • 1.3 Add insertHeartbeatEventsErrors to databaseManager.js to sink rejected records.
  • 1.4 Wire _emitRejectedRecord in heartbeatProcessor.js to directly write all completely unprocessable heartbeats into the heartbeat_events_errors DB.
  • 1.5 Update the openspec specs with these newly supported overflow & validation fallback states.