Skip to content

fix(review): 9 即修 + 13 issue (cron-cr v9 第三轮)#2239

Merged
KevinZhao merged 9 commits into
masterfrom
cron/code-review-20260621-142650
Jun 21, 2026
Merged

fix(review): 9 即修 + 13 issue (cron-cr v9 第三轮)#2239
KevinZhao merged 9 commits into
masterfrom
cron/code-review-20260621-142650

Conversation

@KevinZhao

Copy link
Copy Markdown
Owner

v9 第三轮全面 code review: 5-reviewer / strict file:line dedup / cosmetic 过滤 / 限额满则塞满。本轮聚焦 attachment/transcribe/project/weixin/upstream/node/sysession 等前两轮未深审模块。

即修 (9 commits = 8 fix + 1 cosmetic)

锚点 类型 说明
R202606c-CR-001 P1 bug transcribe 多语言配置解析为单项时 degrade 到单语言,避免 AWS 400
R202606c-CR-002 P1 bug project 配置持锁落盘 + Scan 全程持锁,杜绝并发 Scan 擦除新绑定
R202606c-CR-003 P2 sec attachment meta-missing error 去掉绝对路径
R202606c-SEC-1 P2 sec weixin iLink 错误 body 入 error 前 sanitize
R202606c-GO-002 P2 fix attachment tracker 重复 bump 不再推迟 flush deadline(防 GC 误删)
R202606c-GO-006 P2 perf upstream marshalResult 错误路径归还 reset buffer 而非泄漏池
R202606c-PERF-001 P1 perf projectapi 文件列表排序预计算小写名,省 2×ToLower/比较
R202606c-ARCH-2 P2 refactor attachment MetaPathFor 单一来源,store/tracker 共享

全部受影响包 go test -race 通过 (transcribe/project/attachment/weixin/upstream/dashboard·project)。cosmetic-backlog 追加 5 行。

余项 issue (13)

bug/correctness: #2226 #2227
perf: #2228 #2230 #2231 #2232 #2233
sec: #2229 #2234 #2235 #2238
design (needs-design): #2236 #2237

CR-002 经 fix agent 深挖发现 Scan() 本身在锁外做磁盘加载,已一并将整个 Scan body 纳入锁,附 200 轮并发回归测试。

cron-bot added 9 commits June 21, 2026 14:39
…ker [R202606c-ARCH-2]

The two metaPathFor implementations (store.go, tracker.go) were verified
byte-for-byte equivalent, so this is a pure consolidation with no
behavioral change. Export store's as MetaPathFor and have the tracker
call it, removing the drift risk that could silently split the .meta
namespace between GC and the tracker.
@KevinZhao KevinZhao added the cron-reviewed-pass fix-pr-review cron PASS verdict, ready to merge label Jun 21, 2026
@KevinZhao

Copy link
Copy Markdown
Owner Author

PR #2239 review (cron)

  • 关联 issue: 无显式 Closes(修复锚定 review ID:R202606c-CR-001/002/003、SEC-1、GO-002/006、PERF-001、ARCH-2)
  • 文件域: internal/attachment/{store,tracker}、internal/project/manager.go、internal/transcribe、internal/upstream/connector.go、internal/platform/weixin/api.go、internal/dashboard/project/files_list.go

Findings

[NIT] 陈旧注释与修复矛盾: internal/project/manager.go:216 — 注释称 "this block runs before m.mu.Lock()",但 CR-002 已把 m.mu.Lock() 上移至 Scan() 顶部(line 121),CreatedAt 迁移块现已在锁内运行;建议下轮修正注释。

8 项修复均实质正确:

  • CR-001(transcribe): len(parts)==1 守卫位置正确,用归一化后的 parts[0];测试覆盖尾逗号/首逗号/双逗号/空白。
  • CR-002(project manager): 锁覆盖整个 Scan()(含磁盘 IO/迁移/projects swap);四个 writer 方法在 saveConfigToPath 期间持锁;200 次 -race 并发测试足以复现旧 bug。
  • CR-003(attachment 路径泄漏): errors.New 去掉路径;测试断言 err 不含 meta 路径与分隔符。
  • SEC-1(weixin): osutil.SanitizeForLog 位置正确;真实 httptest 覆盖 NUL/BEL/ESC/tab。
  • GO-002(tracker): 移除 prev.flushAt 赋值,仅更新 timeMS;测试在停 worker 后直驱 handleBump 避免 race。
  • GO-006(upstream pool): buf.Reset() + 条件 Put 与超大丢弃策略一致;毒字节测试确认无残留。
  • PERF-001(file list sort): 预算小写名消除 2×ToLower;对照旧比较器的一致性测试覆盖混合/隐藏/大小写。
  • ARCH-2(MetaPathFor): 从 store.go 导出并删 tracker 重复实现,单一来源。

无 CRITICAL/HIGH/MEDIUM/LOW,仅 1 NIT(cosmetic)。

VERDICT: PASS

@KevinZhao KevinZhao added the cron-retry-attempted Cron 已对该 PR 尝试一次 CI retrigger label Jun 21, 2026
@KevinZhao KevinZhao merged commit f65719b into master Jun 21, 2026
13 of 14 checks passed
@KevinZhao KevinZhao deleted the cron/code-review-20260621-142650 branch June 21, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cron-retry-attempted Cron 已对该 PR 尝试一次 CI retrigger cron-reviewed-pass fix-pr-review cron PASS verdict, ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant