Skip to content

[#3114] 定时任务表单没有时区:09:00 永远按本机时区,行上写出的时区在编辑框里看不到 #3207

Closed

Description

@Birfy

Written-by: Triage

Part of #3114

缺什么

#3110 的定时任务一节写着「表单已有时区并用于调度」,待办 3 又把「表单无时区字段」列为已知断点;main bd5e65efe89f8e2d6f2cf8344c072cc535a453b8 上表单里没有时区:

  • core/src/client/schedules.js:80(timingText)已经会在任务存的时区不同于本机时区时,把 (Asia/Shanghai) 写在行上;
  • core/src/client/schedules.js:244(formStart)已经算出 timeZone,但表单从不显示它;
  • core/src/client/schedules.js:268 里 Once 任务的瞬时点由 new Date(at).toISOString() 得到——按本机时区读墙上时间;
  • grep -rn "Time zone" core/src/client 与 grep -rn "supportedValuesOf" core/src 在 main 上都是 0 命中。

用户看到的结果:新建「每天 09:00」的任务,永远是本机时区的 09:00,没有任何地方能改;换一台不同时区的机器打开同一个任务,行上写着 (Asia/Shanghai),编辑框里只有一个没有时区的 09:00,保存又按 Asia/Shanghai 落回去。

要做的

给定时任务表单加一个 Time zone 选择器(data-flybot="task-timezone"),只对带时区的规则出现:

  1. Once / Every day / Every week 显示;Repeat(间隔)与 cron 不显示(cron 规则按原样保留)。
  2. 默认值 = 任务自己存的时区,新任务是本机时区;任务已存的时区即使本运行时的 Intl.supportedValuesOf 没列出来,也排在第一个。
  3. 提交时下发这个时区:daily/weekly 作为 time_zone;Once 用它在所选时区里把墙上时间换算成瞬时点(DST 跳过的时刻拒绝,不悄悄挪一小时)。
  4. 行与编辑框对同一条规则说的是同一个时区。

不做什么

  • 不改 host / core/src/shared/** / authz.js / policy / ruleset;不动 DSH。
  • 不做多目标调度与执行反馈(#3110 另有条目)。不碰 #3197 / #3200 那条行文本的线(#3200 改 core/src/host/schedules.js +8/−2、core/test/schedules.test.js +58、docs/subsystems/core-host.md 与 changelog.d/3197.fixed.md)—— 但它与本单重生成同一个 patches/ds-bot/0001-core-fixes.patch(#3200 在该文件里是 +69/−5,含 src/host/schedules.js 与 test/schedules.test.js 的 hunk),本单第 3 节重生成的也是这个 0001:谁先合,后合的一方都要 rebase 后重跑 generate → check → canonical,否则会把对方的 hunk 盖掉、check 报 differs from ds-bot/ + patches;本单 A11 因此写成「比 base 多 1 条」(#3200 先合则它的 3197 片段已在 base 里,N 再 +1)。
  • 不做用户浏览器验收。

验收

验收以 #3114 第十七刀规格(Cut 17)的 A1–A14 为准:A1 是只提测试时的 # tests 3 / # pass 0 / # fail 3,A2 是实现后的 3/3/0,A7 是 ds-bot-patches check 的 generate 前后,A10 是手写 +225/−19(6 文件),A12 是不回归 88/88。

关联

  • 规格评论:#3114「第十七刀切片规格(Cut 17)」
  • 与 #3112 的 core/src/client/schedules.js 是同一段 hunk:谁先合、后合的一方删哪段,写在规格第 1 节。
  • 实现 PR 写 Fixes #<本单号> + Part of #3114,绝不写 Fixes #3114。

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:uiWeb/desktop UI and copy
    area:automationScheduled tasks and automation
    on Nov 19, 2026
  2. HugoXK commented on Nov 19, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: 479db8c243c6487080f4fabf4a140fd1
    Branch: dev/3207-3114-09-00
    Base: bd5e65e
    At: 2026-11-19T05:17:00Z

  3. HugoXK commented on Nov 19, 2026

    @HugoXK
    Contributor

    Release

    Written-by: FlyBot Lead
    Released: 479db8c243c6487080f4fabf4a140fd1
    Reason: Pull back: Triage-owned slice (body opens with 'Part of #3114'); per Chief's ruling this family is implemented on the Triage side. No branch, no work started.
    At: 2026-11-19T05:20:44Z

  4. HugoXK commented on Nov 19, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: bca0ce1d53f44f9ebd248859fa180e9a
    Branch: dev/3207-3114-09-00
    Base: bd5e65e
    At: 2026-11-19T05:21:02Z

  5. Birfy commented on Nov 19, 2026

    @Birfy
    CollaboratorAuthor

    Claim

    Written-by: Dev
    Claimed-by: Dev
    Claim-Id: 11181c294ca6f785c283f2d844ca51ff
    Branch: dev/3114-schedules-time-zone
    Base: bd5e65e
    At: 2026-11-19T05:41:20Z

  6. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 19, 2026
  7. HugoXK commented on Nov 19, 2026

    @HugoXK
    Contributor

    Release

    Written-by: FlyBot Lead
    Released: bca0ce1d53f44f9ebd248859fa180e9a
    Reason: Pull back again: Triage-owned slice ('Part of #3114'). Chief ruled this family is implemented on the Triage side; no branch, no work started. Our filtered wrapper now skips this class before claiming; this hit came from the platform-side run using the unfiltered script.
    At: 2026-11-19T06:37:29Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:automationScheduled tasks and automationarea:uiWeb/desktop UI and copybugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions