Skip to content

Fix rescheduling recreated dynamic tasks - #793

Open
saidM wants to merge 1 commit into
rails:mainfrom
saidM:fix/reschedule-recreated-dynamic-tasks
Open

Fix rescheduling recreated dynamic tasks#793
saidM wants to merge 1 commit into
rails:mainfrom
saidM:fix/reschedule-recreated-dynamic-tasks

Conversation

@saidM

@saidM saidM commented Aug 25, 2026

Copy link
Copy Markdown

Fixes #792.

The scheduler reconciles dynamic tasks by key, so a task removed and recreated with the same key between polls currently looks unchanged.

This change tracks the database record associated with each scheduled dynamic task. When the same key points to a new record, the old timer is cancelled and the replacement is scheduled. It also prevents a callback from the previous task from restoring the old schedule.

Direct updates to an existing task record remain unchanged, as documented.

Testing

  • Added coverage for replacing a dynamic task with the same key.
  • Added coverage for direct updates remaining unchanged.
  • Ran the full SQLite test suite: 357 tests, 1,744 assertions.
  • Ran RuboCop.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic recurring-task reschedule is not detected when the same key is recreated before the next scheduler poll

1 participant