Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] CodeceptJS 3.7.x: "tryTo" and "session" do not work together #5120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
kobenguyent merged 2 commits into 3.x from copilot/fix-5116
Sep 1, 2025

Conversation

Copy link
Contributor

@Copilot Copilot AI commented Sep 1, 2025
edited
Loading

  • Analyze the repository structure and understand the issue
  • Identify the problem: both tryTo and session use recorder.session.start() but the session management doesn't support nesting
  • Root cause: sessionId is a single variable that gets overwritten when nested sessions start
  • Created test case that reproduces the hanging behavior
  • Implement stack-based session management to support nested sessions
  • Update session start/restore methods to handle session stack properly
  • Add integration tests demonstrating tryTo inside session and session inside tryTo work
  • Ensure all existing tests still pass
  • Verify the fix resolves the hanging issue with real integration tests

Key Changes:

  • Added sessionStack array to track nested sessions in lib/recorder.js
  • Modified recorder.session.start() to push current session to stack instead of restoring it immediately
  • Modified recorder.session.restore() to pop parent session from stack when available
  • Updated reset() method to clear the session stack
  • Added integration test scenarios in session test file demonstrating both nesting directions work

The fix enables proper nesting of effects that use recorder sessions, resolving the hanging issue when tryTo is used inside session().

Fixes #5116.


💬 Share your feedback on Copilot coding agent for the chance to win a 200ドル gift card! Click here to start the survey.

Co-authored-by: kobenguyent <7845001+kobenguyent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@kobenguyent kobenguyent Awaiting requested review from kobenguyent

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

CodeceptJS 3.7.x: "tryTo" and "session" do not work together

AltStyle によって変換されたページ (->オリジナル) /