Repository navigation
Conversation
twotnguyen
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 6, 2026 14:23
- fixedNow 由固定过去时间改为 Date.now()+HOUR:sweepHints 内 at = max(now, Date.now()),过去的注入值会被真实时钟顶掉,两次 sweep 落在不同毫秒,同毫秒防撞 id 的 sweep 级断言因此不咬回归;用未来时间后 注入值得以保留,format 退回纯时间戳时该段断言稳定失败。 - 删除零调用方的 resetHintTurnSeqForTest 与 formatHintTurnId 的 seq 可选形参,计数器仅由模块内部自增。 Co-Authored-By: Claude Code <[email protected]>
Owner
|
感谢这个修复!复审后我在你的分支上追加了一个 commit(未改动你原有的提交),处理两条非阻断建议:
验证(基于新 head):
这是自动评审的代修提交,最终仍以维护者复审结论为准。 更新:PR 已合入 master(squash 提交 9a16c21),感谢你的贡献!这个修复消除了高负载下巡检提示回合 id 同毫秒相撞、第二条提示可能被去重丢弃的隐患,回归测试也在同毫秒语义上端到端钉死了。欢迎继续参与。 |
|
🚀 Released in v3.58.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
src/core/decision-board/hints.ts:在formatHintTurnId中引入进程内自增序号hintTurnSeq,回合 id 格式由board:<appId>:hint-<round>拓展为board:<appId>:hint-<round>-<seq>;parseHintTurnId正则支持兼容解析可选的序号后缀-<seq>。test/decision-board-hints.test.ts:更新正则断言,并补全同毫秒固定时间戳下两次生成turnId与两次sweepHints回合 id 互不相同的回归测试。为什么
原实现将本轮毫秒时间戳
round直接作为turnId后缀。在高负载或测试连续快速触发时,同毫秒内连续两次sweepHints会生成完全相同的turnId,导致test/decision-board-hints.test.ts:284偶发断言失败(时序 flake),同时在真实环境中存在通知被 worker 误作为同回合去重而丢失的隐患。影响面
仅影响看板巡检提示(hint notice)的回合 id 格式与唯一性,不影响看板正常批次(数字批次号)与卡片交互。
实际测试验证
AssertionError: expected board:app_test:hint-1700000000000 not to be board:app_test:hint-1700000000000)。bunx vitest run test/decision-board-hints.test.ts32/32 测试全部通过(100% GREEN)。tsc --noEmit0 错误。Fixes #2927