Repository navigation
Conversation
…any rules The chain rule nested one observable per rule, so subscribing to a chain of a few thousand rules exceeded the call stack and the result never settled. Each rule result is now awaited before the next rule runs.
There was a problem hiding this comment.
Code Review
This pull request refactors the chain rule execution in Angular DevKit Schematics to process rules sequentially using await lastValueFrom instead of chaining Observables. This prevents potential stack overflow issues when executing a large number of rules, which is verified by a new test case running 20,000 rules. There are no review comments to address, and we have no additional feedback to provide.
clydin
approved these changes
Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
chain()builds one nested observable per rule. With a few thousand rules, subscribing to the result goes past the call stack limit. Locally, 2000 no-op rules gave a promise that never settled, and the issue reportsRangeError: Maximum call stack size exceeded.Issue Number: #17851
What is the new behavior?
chain()awaits each rule's result before calling the next rule, so the stack depth no longer grows with the number of rules. The new spec inbase_spec.tschains 20000 rules. It times out on main and passes with this change.Does this PR introduce a breaking change?
Other information
Tested with
bazel test //packages/angular_devkit/schematics/... //packages/schematics/angular:test //packages/angular_devkit/schematics_cli/....Closes #17851