Skip to content

[Bug]: Run now on a paused one-time task deletes the task #38453

Closed

Description

@yaacovcorcos

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Create a one-time scheduled task for a time in the future, and pause it.
  2. Click Run now on it. Run now works while a task is paused.
  3. Let the run finish successfully.

Since #37991, a successful run of a once task deletes the task when next_run_at IS NULL, which is taken as proof that the occurrence was used up (ScheduledTaskService.ts, the DELETE FROM scheduled_tasks … AND next_run_at IS NULL after a run settles). A paused task always has a null next_run_at, so the rule also matches a paused task that was only run by hand.

Expected behavior

The paused task stays with its configured time and the manual run recorded, so resuming it before that time schedules it again. Only a run at or after that time uses it up.

Actual behavior

The task is deleted as soon as the manual run succeeds, so its scheduled time is lost and the user has to recreate it.

Impact

Minor bug or occasional failure

Version or commit

main at c488253

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions