fix(core): match tasks by id in run-many terminal output lifecycles #17460
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.
Current Behavior
The run-many terminal rendering is not handling completed tasks correctly.
This happens because it matches the task objects by reference, not by id. It was not an issue until recently because every operation in different parts of the code was mutating the task objects. A PR (b6cdf9d#diff-e9bae83332b3d6e57c023959ab2e5f191c97e0a154a8c1d36dd81f8f869e1bdfR243R247) recently created a new task instance which caused the issue to appear.
Expected Behavior
The run-many terminal rendering should handle completed tasks and match them correctly.
The task matching in the terminal output lifecycles was changed to match by id, which is more resilient to external code handling tasks. Since creating a new task object in the task orchestrator was not needed, I also updated the change made by the previous PR to keep the previous approach of mutating the task object.
Related Issue(s)
Fixes #