async-cache-single-flight: the selection regex matches `constants.set(` as `s.set(` and the law card's own example text

未关闭
#437 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
53/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
testing-qa

调研方向

Start with the gate regex in async-cache-single-flight.ts:72-77 and the cited matches in ts-model.ts:714 and cache-harness-laws.ts:83-85. Read how audit-engine.ts:278 represents its disk JSON cache, then check the gate against those examples and the in-memory map case. Done means the gate avoids the false matches described in the issue and still selects the intended single-flight cases.

由索引模型根据 Issue 内容生成。

描述

bug

Found in the 8.0.0 self-audit triage: RoC 7.29.1 (npm, 5fc54afe) on a clean clone of develop at 2d2fa9a, with typescript resolvable (verdict compliance, 0 failed / 46 warnings). The bucket method and per-law tables are kept by QA; counts are from that run.

What happens

The gate regex (async-cache-single-flight.ts:72-77) back-references the map name with \1 but has no left boundary, so s.set( matches inside constants.set( (ts-model.ts:714); a law registry file is selected by the card's own example (cache-harness-laws.ts:83-85). The single finding in RoC (audit-engine.ts:278) is a disk JSON cache: a promise cannot be stored there and concurrent callers of a CLI audit are separate processes — a different concurrency model than the in-memory map the law is about.

Suggested direction

Word boundary before the back-reference; skip string contents (M1); recognise disk/JSON caches as outside the in-memory single-flight concern.

主要语言
TypeScript
星标
0
派生
0
平均合并
38 分钟
30 天内合并 PR
96

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Rule-Of-Code/RoC 的其他 Issue

查看 Rule-Of-Code/RoC 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。