Skip to content

Keep prior scheduled-run error while an accepted rerun is pending #145

Open

Description

@chrisohearn

Finding

Reported as P3 in the exact-head review of PR #140, bound to base 78f183a40d8f9682ffb0bfbf05714aa4c11ac094 and head 93ba9bf83a7f1e4bd937642ba43b92738d000e68.

On the accepted-dispatch path in apps/server/src/scheduledTasks/ScheduledTaskService.ts:1304-1306, the task keeps previousRun.status until the newly accepted run finishes, but clears lastRunError. If the previous run failed, the record temporarily retains failed with no reason. runInProgressSince makes the web UI show the new run as running, but ScheduledTaskReliability reads lastRunError when collecting the latest failed-task detail, so the previous failure reason is unavailable during that interval.

This is a regression of the pending-run contract documented by merged PR #71: while a run is pending, the previous status and error are retained. The earlier #67 defect was false success before completion; this issue tracks only the later loss of the previous error.

Root-cause key: scheduled-task/accepted-rerun-clears-prior-error

Relationship and risk: introduced by the upstream merge resolution in PR #140; P3 observability/state consistency. It does not misreport the new run as completed, change dispatch behavior, or hold PR #140's merge.

Acceptance

  • After a failed run, an accepted rerun preserves the previous error while its outcome is pending.
  • A successful rerun records success and clears the old error; a failed rerun records the new failure.
  • Focused service tests cover the failed-then-accepted sequence and both terminal outcomes.
  • The UI continues to show the accepted rerun as running while pending.

Rollback: revert the error-retention change if the focused tests fail; no schema or migration change is required.

Ownership and next action: the PR #140 sync owner raised this finding. Keep it unassigned until a separate repair owner accepts it; then implement and verify it in a separate PR using the focused scheduled-task tests and vp run check:changed. Resume when that repair PR has an owner. This remains a P3 follow-up, not a release gate.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions