Skip to content

fix: allow duplicate auto dependencies - #2144

Open
whoalin1 wants to merge 1 commit into
caolan:masterfrom
whoalin1:devin/1796057334-auto-duplicate-dependencies
Open

whoalin1 wants to merge 1 commit into
caolan:masterfrom
whoalin1:devin/1796057334-auto-duplicate-dependencies

Conversation

@whoalin1

Copy link
Copy Markdown

Closes #2133.

Summary

auto() incorrectly reported a recursive dependency when a task listed the same dependency twice. Runtime dependency listeners already complete correctly in that case; only checkForDeadlocks() over-counted the dependency because getDependents() reports each dependent task once while the initial counter used the raw dependency-array length.

The deadlock check now counts unique dependency names, so duplicate edges do not affect cycle detection. A regression test covers ['task1', 'task1', fn] completing with the expected result.

Validation

  • Reproduced the false recursive-dependency error from the issue before the fix.
  • npx mocha test/auto.js — 26 passing.
  • npm run mocha-node-test — 704 passing.
  • npm run lint -- --no-fix — passed.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@whoalin1

whoalin1 commented Nov 30, 2026 •

Copy link
Copy Markdown
Author

Local validation on the PR head passed with Node 24: the targeted duplicate-dependencies regression passed, and the full npm run mocha-node-test suite passed 704/704.

This branch has not been deployed

No deployments
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.

auto throws "recursive dependency" when a task lists the same dependency twice

1 participant