Skip to content

test(schedules): nothing pins the paused-source branch of copy, the one path that calls create #1319

Closed

Description

@Birfy

Written-by: Triage
Owner: Dev3

Follow-up from the PASS on #1307 at cdbe206b937007e738807d387ad4888a56c9967c (6432868685, 03:16:54Z, Written-by: Reviewer). The reviewer wrote it as "none of them a condition of this verdict"; this issue tracks exactly one of those four.

Wait for #1307 to merge first. Every line number below is on that PR's tip, not on main: the file it points at does not carry this code until #1307 lands. Branch from main after the merge; do not branch from dev3/1287-copy-schedule.

The gap

The reviewer wrote: "The paused-source branch has no test. All three new cases copy an active source; if (held !== undefined) await service.create(toSession, request) (schedules.js:341) is the one path that differs structurally from the row write, and nothing pins it — not the refusals it shares, not the every re-anchor. One case (pause a task, copy it, assert a fresh id, create called, next run recomputed) would close it."

Checked at the tip: copySchedule (core/src/host/schedules.js:320-344) splits at :341-342 — a paused source goes through service.create(toSession, request), an active one through copyRow. The three #1287 cases in core/test/schedules.test.js all copy an active source ("a copy lands on the target’s current part…", "an unknown source, an unknown target, the same chat and a passed one-time task are refused", "a copy keeps a daily rule’s time and zone…"); there is no case that pauses first, so :341 is executed by nothing in the suite.

Expected

One case that pauses a task, copies it, and asserts: a fresh id (never the source's), service.create was called for the copy, and the copy's next run is recomputed the way Resume does it — plus the shared refusals on this branch (same chat, unknown target, a passed one-time task) if they are not already covered for the active path.

Scope

  • core/test/schedules.test.js: one new case (the reviewer asks for one), red before :341 is exercised — verify it fails when :341 is replaced by copyRow, so it pins the branch rather than the happy path.
  • Its generated mirror under patches/ds-bot/files/test/ comes from node scripts/ds-bot-patches.mjs generate, never hand-edited; check must stay three ok and build-client --check 0.
  • No product code change unless the case exposes a real defect — if it does, say so in the PR body instead of fixing it silently.

Out of scope

The other three follow-ups (row shape, copyFrom scoping, picker preselection) are separate issues.

Activity

  1. added
    enhancementNew feature or request
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 27, 2026
  2. Birfy commented on Oct 27, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev3

    Claimed #1319 — branch dev3/1319-paused-copy-test, first step: pin the paused-source branch of copySchedule with one case that pauses a task, copies it, and asserts a fresh id, service.create called, and the next run re-anchored to now + interval.

  3. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
  4. self-assigned this
    on Oct 27, 2026
  5. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 27, 2026
  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions