fix(dashboard): 修复定时任务编辑状态回填异常 - #770
Merged
deepcoldy merged 1 commit intoAug 7, 2026
Merged
Conversation
修复 dashboard 定时任务编辑弹窗的状态回填问题: - schedule row 返回原始 schedule 字段,保证调度规则输入框可回填; - schedule.updated 事件在关闭静默时显式带 silent:false,避免 SSE/JSON 丢弃 undefined 后前端缓存保留旧值。 Co-authored-by: TRAE CLI <noreply@bytedance.com>
deepcoldy
approved these changes
Aug 7, 2026
deepcoldy
left a comment
Owner
There was a problem hiding this comment.
结论:通过,未发现阻塞项。
核对结果:
ScheduleRow.schedule取自持久化任务的原始表达式,composeScheduleRow统一覆盖 GET 列表、POST/PATCH 响应和schedule.created事件,因此刷新前后编辑都能正确回填。- 持久化 patch 与事件 patch 的拆分符合语义:关闭静默时落盘仍清理字段,事件显式发送
silent:false;开启时发送true;未修改静默时事件不携带该字段,不会误清状态。 - 改动不影响调度计算、执行位置、Lark 卡片 DTO 或
schedules.json格式。
实际验证:
pnpm build:通过。pnpm vitest run test/scheduler-toggle-delivery.test.ts test/dashboard-ipc.test.ts:124/124 通过。pnpm test:13068 个测试通过、1 个无关套件在并发全量运行时beforeAll超时;单独重跑test/group-join-shared-routing.test.ts为 14/14 通过。git diff --check:通过。
非阻塞观察:修改调度后若 computeNextRun() 返回空,既有 nextRunAt: undefined 仍会在 SSE 序列化时丢键,缓存可能暂留旧值。该问题早于本改动,刷新可自愈,建议单独修复,不要求本 PR 扩大范围。
|
🚀 Released in v3.10.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.
改了什么
schedule字段,让编辑弹窗的「调度规则」输入框能正确回填。silent字段,但schedule.updated事件显式发送silent:false。GET /api/schedules返回的行数据包含原始schedule。silent:true切到false时,dashboard cache 能收到可序列化的silent:false。为什么
定时任务编辑弹窗依赖
editing.schedule初始化「调度规则」输入框,但后端返回给 dashboard 的 schedule row 只有parsed.display,没有原始schedule字段,导致弹窗里该输入框为空。另一个同链路问题是:
silent:false在持久化层会被规范化为字段缺失。之前同一个 patch 直接发给 dashboard,经过 SSE/JSON 后silent: undefined被丢弃,前端 cache 无法清掉旧的silent:true,表现为编辑保存后静默状态仍显示开启。影响面
schedules.json的持久化格式。验证
pnpm vitest run test/scheduler-toggle-delivery.test.ts通过。pnpm vitest run test/dashboard-ipc.test.ts -- -t "includes raw schedule"通过。pnpm build通过。silent:true -> false -> true均能在 dashboard 聚合列表即时反映;临时任务已删除。botmux-0/1/2与botmux-dashboard全部 online。