- Notifications
You must be signed in to change notification settings - Fork3.4k
fix(driver): reset command log nesting after grouped commands in cy.origin#33289
Open
nnyouung wants to merge 9 commits intocypress-io:developfrom
Open
fix(driver): reset command log nesting after grouped commands in cy.origin#33289nnyouung wants to merge 9 commits intocypress-io:developfrom
nnyouung wants to merge 9 commits intocypress-io:developfrom
Conversation
CLAassistant commentedJan 27, 2026 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Collaborator
cypress-app-bot commentedJan 27, 2026
|
nnyouung added a commit to nnyouung/cypress that referenced this pull requestJan 27, 2026
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in theCursor dashboard.
Uh oh!
There was an error while loading.Please reload this page.
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 freeto 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.
Uh oh!
There was an error while loading.Please reload this page.
Additional details
This PR fixes a bug where grouped commands (e.g. within) inside cy.origin() did not reset the Command Log nesting level, causing subsequent groups to appear nested under the previous one.
Root cause
Cross‑origin logs were mutating or inheriting the primary origin’s log group stack (logGroupIds), so the group level did not properly reset after a grouped command finished.
Fix
Prevent cross‑origin logs from mutating primary logGroupIds (ignore groupStart/groupEnd in primary).
Pass originLogGroupLevel/Id metadata from cy.origin to the spec bridge.
Only fill groupLevel/group when missing, preserving already computed values.
Impact
Grouped commands inside cy.origin() now exit correctly, so subsequent commands appear at the expected nesting level.
Note
Medium Risk
Touches core command-log grouping/state logic used broadly across the runner; mistakes could mis-group or mis-render logs, especially in cross-origin scenarios.
Overview
Fixes
cy.origin()command log grouping so grouped commands (e.g.within) correctly reset nesting, preventing cross-origin logs from mutating the primary origin’slogGroupIdsstack.This threads
originLogGroupLevel/originLogGroupIdfrom the primarycy.originlog group into the spec bridge, and updatesLogdefaulting logic to scope group tracking by origin, ignoregroupStart/groupEndmutations for cross-origin logs on the primary, and only backfillgroup/groupLevelwhen missing. Adds an e2e regression test for group-level reset behavior and a changelog entry.Written byCursor Bugbot for commit6e979d1. This will update automatically on new commits. Configurehere.
Steps to test
- Run:
yarn workspace @packages/driver cypress:run --spec cypress/e2e/e2e/origin/commands/log.cy.ts- (Optional, visual) Open mode:
yarn workspace @packages/driver cypress:open --e2eRun log.cy.ts and confirm the second 'within' is at the same level as the first.
How has the user experience changed?
Before
After the first grouped command finishes inside cy.origin(), the Command Log group level does not decrease.
Subsequent commands appear incorrectly nested as if still inside the previous group.
After
Grouped commands inside cy.origin() correctly exit their group.
Subsequent commands display at the correct log level.
(Screenshots/GIF: add before/after if available)
PR Tasks
cypress-documentation?type definitions?