Skip to content

fix(run): 试跑不再写入 periodSuccess/lastSuccessAt,避免吞掉当天调度的投递名额 - #196

Merged
morehao merged 1 commit into
mainfrom
fix/dry-run-no-delivery-slot
Nov 23, 2026
Merged

morehao merged 1 commit into
mainfrom
fix/dry-run-no-delivery-slot

Conversation

@morehao

@morehao morehao commented Nov 23, 2026

Copy link
Copy Markdown
Owner

背景 / Why

Closes #195。

在面板点一次「试跑(不提交)」之后,当天该周期的定时运行不会再发生——不提交、不开 PR,而且静默:历史里没有记录,nextRunAt 照常显示次日,看起来一切正常。

根因:Runner.record() 无条件把「成功」写进当天去重标记,未区分 dryRun。而 schedule.succeededToday() 正是读 periodSuccess / lastSuccessAt 判「该周期今天已成功」,于是试跑一次就把当天该周期的投递名额吞掉。

改动 / What

  • src/host/runner.ts:只让真正走完投递路径的运行占用当天名额(delivered = ok && !dryRun);lastRunAt 保持无条件写(它表示「最近一次尝试」,不是去重键)。
  • src/state.ts:lastSuccessAt / periodSuccess 注释注明「不含 dry-run」。
  • test/runner.test.mjs:新增回归——dry-run 后两者均为空,正常 run 两者写入。

说明

  • 影响面:面板「试跑」与 trending_run 的 dryRun 都会踩中;默认 period=daily 时最常见是日榜当天被吞。
  • 属插件编排层 bug,不涉及核心 / 契约,无跨仓改动。

验证

  • npm run check 全绿:380 单测通过(含新增 1),AC-P 12/12。

Runner.record() 之前无条件把「成功」写进当天去重标记,未区分 dryRun。
schedule.succeededToday() 正是读 periodSuccess / lastSuccessAt 判「该周期今天
已成功」,于是「试跑(不提交)」一次后,当天该周期的定时投递会被静默跳过:
不进历史、无日志、nextRunAt 仍显示次日。

改为只让真正走完投递路径的运行占用名额(delivered = ok && !dryRun);
lastRunAt 仍无条件写,它表示「最近一次尝试」,不是去重键。

影响:面板「试跑」与 trending_run 的 dryRun 都会踩中,默认 period=daily。
补一条回归:dry-run 后 periodSuccess/lastSuccessAt 均为空,正常 run 两者写入。

Closes #195
@morehao
morehao merged commit 3675348 into main Nov 23, 2026
1 check passed
@morehao
morehao deleted the fix/dry-run-no-delivery-slot branch November 23, 2026 02:57
@morehao morehao mentioned this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(run): 试跑会写入 periodSuccess/lastSuccessAt,导致当天定时投递被静默跳过

1 participant