Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(schedule): ensure auto generated task IDs are always unique
Previously, we were generating task IDs based on the length of the tasks object. However, this falls short if any tasks have been unscheduled. For example, let's say we schedule 2 tasks, resulting in tasks with IDs of `"0"` and `"1"`. Then we unschedule task `"0"`. The length of the tasks object is now `1`, so when we attempt to schedule the next task we will use the ID `"1"`. This will conflict with the existing task, causing an error to be thrown.
- Loading branch information