Skip to content
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

Actions launched from a server ready action in compound launch configs don't honor the stopAll flag #163124

Closed
samamorgan opened this issue Oct 9, 2022 · 9 comments · Fixed by #163779
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verification-found Issue verification failed verified Verification succeeded
Milestone

Comments

@samamorgan
Copy link

samamorgan commented Oct 9, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.71.2
  • OS Version: Windows_NT x64 10.0.19044

Steps to Reproduce:

  1. Create a compound launch configuration with "stopAll": true where one of the configs includes serverReadyAction
  2. Launch a debug session with this configuration
  3. Press the stop button
    • Expected: All sessions stop
    • Actual: The sessions enumerated in the compound configurations stop, but the session launched under serverReadyAction does not. The user must click stop twice for all sessions to cease.

My launch config:

{
  "version": "0.2.0",
  "compounds": [
    {
      "name": "Debug app",
      "configurations": ["Django", "Vite"],
      "stopAll": true
    }
  ],
  "configurations": [
    {
      "name": "Django",
      "type": "python",
      "request": "launch",
      "program": "${workspaceFolder}/manage.py",
      "args": ["runserver"],
      "django": true,
      "justMyCode": true,
      "presentation": { "hidden": true },
      "cwd": "${workspaceFolder}",
      "serverReadyAction": {
        "pattern": ".*(https?:\\/\\/\\S+:[0-9]+\\/?).*",
        "uriFormat": "%s",
        "action": "debugWithChrome"
      }
    },
    {
      "name": "Vite",
      "type": "node",
      "request": "launch",
      "runtimeExecutable": "npm",
      "runtimeArgs": ["run", "dev"],
      "presentation": { "hidden": true },
      "cwd": "${workspaceFolder}"
    }
  ]
}

Video demonstrating the behavior:

sampleapp.-.Visual.Studio.Code.2022-10-09.09-14-25.mp4
@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.72.0. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@samamorgan
Copy link
Author

I just upgraded to 1.72.0 and the issue is unchanged.

@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Oct 10, 2022
@roblourens roblourens added this to the Backlog milestone Oct 10, 2022
@roblourens
Copy link
Member

"stopAll" isn't really related here - normally, there is no relationship between the server and browser debug session. But it might make sense to stop the browser session when the server session is stopped.

We could try starting the browser session as a child of the server session, I don't think a child is automatically stopped when a parent is stopped though. The debug-server-ready extension could watch for the server session to end, and then manually stop the browser session. There might be some valid case when you want to keep debugging the browser after the server has terminated, so there could be an option for this too.

Thoughts @connor4312?

@connor4312
Copy link
Member

I don't think having a child session is a good thing, but we could have the debug-server-ready extension monitor the state as you suggest. I think that would be fine.

@roblourens roblourens added the help wanted Issues identified as good community contribution opportunities label Oct 11, 2022
@samamorgan
Copy link
Author

Whatever you folks think is best works for me. I've sidestepped the issue for now by just adding a third debug config that launches a browser, but it isn't quite as slick as using serverReadyAction since the browser launches and waits. I also can't parse out the URL this way like serverReadyAction, I have to hardcode it, which isn't ideal for long-term maintenance.

@babakks
Copy link
Contributor

babakks commented Oct 13, 2022

@roblourens @connor4312 Do you think introducing a new property in serverReadyAction is a good idea? something like killOnServerStop:

{
  "serverReadyAction": {
    "pattern": ".*(https?:\\/\\/\\S+:[0-9]+\\/?).*",
    "uriFormat": "%s",
    "action": "debugWithChrome",
    "killOnServerStop": true
  }
}

@roblourens
Copy link
Member

That would make sense to me. I don't have time to work on it right now but would take a PR

@babakks
Copy link
Contributor

babakks commented Oct 16, 2022

@roblourens I'll submit a PR.

@babakks
Copy link
Contributor

babakks commented Oct 16, 2022

@roblourens Just submitted the PR for you to check it whenever you had time.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 17, 2022
@roblourens roblourens modified the milestones: Backlog, November 2022 Nov 17, 2022
@roblourens roblourens added feature-request Request for new features or functionality verification-needed Verification of issue is requested and removed bug Issue identified by VS Code Team member as probable bug labels Nov 17, 2022
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 18, 2022
@paulacamargo25 paulacamargo25 added verified Verification succeeded verification-found Issue verification failed and removed verification-needed Verification of issue is requested labels Dec 1, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders verification-found Issue verification failed verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants