fix: Aliases properly retry commands from inside custom commands #23663
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.
User facing changelog
Fix: Mixing custom commands and aliases now works again. Fixes regression introduced between 10.4.0 and 10.5.0.
Additional details
When a custom command invoked cypress commands, these 'internal' commands' return values are properly used as the subject for future commands, via the 'subjectLinks' internal Cypress state.
However, as of 10.5.0, aliases were not respecting these links, meaning they would end up with 'undefined' for a subject instead of the proper one (which would come from replaying the 'internal' commands).
See the test added by this PR for a more concrete example.
Steps to test
Added automated test demonstrating the issue. Also see the repro in #23652 for external validation.
How has the user experience changed?
PR Tasks
cypress-documentation
?type definitions
?