Skip to content

fix: a cancelCancellableTasks() in beforeQueue cancels the own tasks queued next - #1884

Merged
mshima merged 1 commit into
yeoman:mainfrom
mshima:cancel-before-queue
Oct 18, 2026
Merged

mshima merged 1 commit into
yeoman:mainfrom
mshima:cancel-before-queue

Conversation

@mshima

@mshima mshima commented Oct 18, 2026

Copy link
Copy Markdown
Member

Summary

queueOwnTasks() creates a new task status, so a cancelCancellableTasks() called in beforeQueue, before it, was lost: every own task ran.

The use: a generator that, in beforeQueue, composes other generators (and depends on them) but must not run its own cancellable tasks, like an application generator delegating an application type to a blueprint.

  • queueTasks() creates the task status before beforeQueue. When beforeQueue cancels it, the cancel is applied to the own tasks once _queueTasks() queued them.
  • The own tasks are still queued, so the before:queueOwnTasks and queueOwnTasks listeners run as before: of the tasks they queue, only the cancellable ones are cancelled.
  • The tasks that are not cancellable and the generators composed in beforeQueue still run.
  • Without a cancel in beforeQueue nothing changes; startOver() is unchanged.

Test plan

  • eslint, prettier, build
  • vitest: a cancel in beforeQueue with a generator composed and a task that is not cancellable (they run, the own cancellable task does not; fails without the fix), and the own tasks without a cancel

🤖 Generated with Claude Code

…queued next

queueOwnTasks() creates a new task status, so a cancelCancellableTasks()
called in beforeQueue, before it, was lost and every own task ran. The
cancel is applied to the own tasks once queued; the tasks that are not
cancellable and the generators composed in beforeQueue still run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mshima
mshima merged commit 59cd8f2 into yeoman:main Oct 18, 2026
16 checks passed
@mshima
mshima deleted the cancel-before-queue branch October 18, 2026 21:08
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.

1 participant