Repository navigation
Fix first scheduled runs and walkthrough UI regressions - #1437
Robert0622 wants to merge 7 commits into
Conversation
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
Co-Authored-By: Claude Code <noreply@anthropic.com>
issueListEmptyState() was added in this PR but web/i18n-en.js was not updated with the two new keys. The search-not-found empty state now shows translated text in English UI. Co-Authored-By: Claude Code <noreply@anthropic.com>
解冲突 + 补英文文案 + 部署实测:head
|
新 PR 独立 CR + 部署实测
|
After dispatching from the issue editor the button text was reset to '启动 SOP', reverting the Tencent#1286 rename while index.html labels it '启动 LOOP'. Restore the LOOP wording and assert it in issues_list_test. Co-Authored-By: Claude Code <noreply@anthropic.com>
更正 + 修复:PR head 现在是
|
| 任务 | main | 本 PR |
|---|---|---|
| 每 3600s(创建于 05:18:16/17) | 05:18:30 第一个 tick 就跑了 | 2.5 分钟内一直没跑 ✅ |
| 每 30s | 05:18:30 立刻跑 | 05:19:01 才第一次跑(创建 ≥30s 后),之后每 30~45s 一次,都是 success ✅ |
cron * * * * * |
05:18:30 立刻跑 | 05:19:01 第一次跑(第一个整分),05:20:01 第二次 ✅ |
- 本 PR 上点「立即运行」:已停用的 3600s 任务马上执行,success,模型回复
ok✅ - 重启本 PR 进程(保留数据库):新建的 3600s 任务 50 秒内仍然没跑;另一个把
createdAt改到 2 小时前、从没跑过的任务,重启后第一个 tick 就执行了,success ✅
2~6. 浏览器(无头 Chromium,中英文各跑一遍)
| 场景 | main | 修复前 b4ba1080 |
本 PR |
|---|---|---|---|
| 批量删除需求的危险确认框:默认焦点 | 确认 | 取消 | 取消 ✅ |
| 焦点在弹窗卡片上按 Enter | 直接删了(GET 404) | 弹窗不关、需求还在 | 弹窗不关、需求还在 ✅ |
| 默认焦点按 Enter / 按 Esc | 删除 | 取消,需求还在 | 取消,需求还在 ✅ |
| 点「确认删除」 | 删除 | 删除 | 删除 ✅ |
| 非危险确认(回归检查) | 聚焦确认、Enter 确认 | 同左 | 同左 ✅ |
| 搜索无结果(中文) | 当前项目没有匹配的工作项 | 新文案 | 没有符合搜索条件的工作项 / 请尝试其他关键词… ✅ |
| 搜索无结果(英文) | No matching work items in this project | 露出中文 | No work items match your search / Try other keywords… ✅ |
| 从详情「概览」页签编辑并保存 | 抽屉关掉 | 回到概览并显示新标题 | 回到概览并显示新标题,标题已保存 ✅ |
| 从列表直接编辑并保存(回归检查) | 不打开详情 | 同左 | 同左 ✅ |
| 编辑弹窗点「启动 LOOP」后按钮文字 | 正在调度… → 启动 LOOP | 正在调度… → 启动 SOP / Start SOP | 正在调度… → 启动 LOOP / Start LOOP ✅ |
真实的待审批运行(只有一个审批节点的 LOOP,节点处于 waiting_approval)的 LOOP 卡片 |
运行中 / Running | 待审批 | 待审批 / Awaiting approval ✅;「正在运行」筛选里也能看到 |
| 同一个 LOOP 同时有待审批和运行中的运行 / 只有运行中的运行 | 运行中 / 运行中 | 待审批 / 运行中 | 待审批 / 运行中 ✅ |
观测页「月」粒度本期运行数(这条运行没结束,finishedAt=0001-01-01) |
0 | 1 | 1 ✅(日、周粒度三边都是 1) |
- 三套实例的页面都没有 JS 报错,也没有 5xx。
校验
go vet ./internal/schedule ./web通过;go test ./internal/schedule ./web通过,go test ./internal/httpapi -run Schedul通过;go build ./...通过。- webtest 315/315 通过。
- CI 16/16 全绿(head
cdba90a4)。
另外
04acb124 误推到 Tencent/LoopForge 后留下了一个多余分支 walkthrough/thr-b04ebdb20b8c,本 PR 不用它(PR head 在 fork 上)。要删的话需要先请求批准,本次没有动它。
crispinhu27
left a comment
There was a problem hiding this comment.
初审:APPROVE(head cdba90a4,base main c039a78a)
审查范围
internal/schedule/service.go:jobDue、claimJob,以及 RunNow/StartNow 路径;对照了repo.PutScheduleJob怎么写 CreatedAt,SetScheduleJobEnabled怎么启停。web/app/observability.js:未完成运行的事件时间与区间判断,对照后端analytics.go的分桶口径。- 危险确认框(
app.jsafConfirm/bindConfirmModal)、工作项搜索空态、详情编辑后恢复页签、LOOP 卡片待审批状态。 - 用
git show --remerge-diff核对了合并提交b4ba1080的冲突解法(只有web/app/issues.js有冲突),以及之后的04acb124、cdba90a4。
验证(隔离 MariaDB + 合成数据,head 与 main 对照)
go test ./internal/schedule/... ./web/:两边都通过。webtest npm test:315/315。CI 16/16 通过。- 调度:用临时测试按 15 秒一跳模拟 ticker,另起两个真实服务各建一个 interval 60s 任务和一个每周 cron 任务。
- 新建任务:head 第一次执行在创建后一个周期,main 保存后立即执行。
- 升级前已有、从未运行过的老任务(createdAt 改成 30 天前):head 会立即补跑一次。
- 暂停后恢复、手动运行之后的下一次执行:head 与 main 行为一致。
- 上述场景都没有出现漏跑或连跑。
- 无头 Chromium:
- 危险确认框默认聚焦「取消」,焦点在卡片上按 Enter 不会确认,焦点在确认按钮上按 Enter 会确认;普通确认框和 prompt 不受影响。
- 搜索无结果时显示新提示,英文文案也已补上。
- 从详情的概览页签编辑并保存后,回到概览页签并显示新标题(main 上抽屉会直接关闭)。
- 卡片同时有等待和运行中的实例时显示「待审批 / 1 个实例等待门禁」;只有运行中的实例时显示「运行中」。
- 可观测性:
finishedAt为零值的 waiting trace,head 计入区间,事件时间取 createdAt,和后端趋势按 CreatedAt 分桶的口径一致;main 会把它的时间算成公元 0001 年。
本轮过程中修复的问题:b4ba1080 解决冲突时,dispatchIssue 的 finally 把按钮文字改回了「启动 SOP」,main 上是「启动 LOOP」。我在 b4ba1080 的构建上实测复现:点击后按钮从「启动 LOOP」变成「启动 SOP」。作者在 cdba90a4 修复了这个问题,我在 cdba90a4 的构建上复测,点击前后都是「启动 LOOP」,状态 FIXED。
没有发现阻塞问题。以上结论只覆盖上述路径和场景,不代表没有其他缺陷。
未验证的部分:外部执行(external execution)未完成时,后端趋势和前端的口径是否一致。本地没法造出这类数据,所以没有验证。这部分不是本 PR 改的。
在最新 main
|
Tencent#1437 fixes the same first-run bug in jobDue. Use its implementation (first timer run anchored at CreatedAt for both Cron and interval jobs) so either PR can merge first without conflicting in internal/schedule/service.go and service_test.go. Keep the Cron first-occurrence regression test. Co-Authored-By: Claude Code <noreply@anthropic.com>
Keeps the UpdatedAt anchor from f1ac1eb on top of the Tencent#1437 implementation: re-enabling or reconfiguring a job that has never run no longer fires an occurrence missed before it was saved. The change sits outside the lines Tencent#1437 edits, so the two PRs still merge cleanly. Co-Authored-By: Claude Code <noreply@anthropic.com>
20:00 轮:与新 main
|
#1437 fixes the same first-run bug in jobDue. Use its implementation (first timer run anchored at CreatedAt for both Cron and interval jobs) so either PR can merge first without conflicting in internal/schedule/service.go and service_test.go. Keep the Cron first-occurrence regression test. Co-Authored-By: Claude Code <noreply@anthropic.com>
Keeps the UpdatedAt anchor from f1ac1eb on top of the #1437 implementation: re-enabling or reconfiguring a job that has never run no longer fires an occurrence missed before it was saved. The change sits outside the lines #1437 edits, so the two PRs still merge cleanly. Co-Authored-By: Claude Code <noreply@anthropic.com>
23:00 轮验证
|
| 项目 | 结果 |
|---|---|
| 新提交 | 无(head 未变) |
试合并 main be6918d7 |
无冲突,14 个文件 |
| CI | 16/16 ✓(APPROVED) |
| webtest(本地) | 315/315 ✓ |
| go vet ./internal/... | 通过 |
| 未解决 review thread | 0 |
新 main 只合入了 #1461(发版 chore),无文件重叠,上一轮结论不变:五项 UI 回归修复(首次调度、危险确认框焦点、空状态文案、SOP 卡片待审批、工作项编辑返回)均已验证,可合入。token 身份是 PR 作者本人,只评论,不点 Approve。
改动
验证范围
🤖 Generated with Claude Code