Skip to content

debugger: Fix restart only working once per session#51247

Merged
Anthony-Eid merged 4 commits intozed-industries:mainfrom
nelsoncampos-cloudwalk:fix/dap-capabilities-event
Mar 12, 2026
Merged

debugger: Fix restart only working once per session#51247
Anthony-Eid merged 4 commits intozed-industries:mainfrom
nelsoncampos-cloudwalk:fix/dap-capabilities-event

Conversation

@nelsoncampos-cloudwalk
Copy link
Copy Markdown
Contributor

@nelsoncampos-cloudwalk nelsoncampos-cloudwalk commented Mar 11, 2026

Session::restart_task is set to Some when a restart is initiated but never cleared back to None. The guard at the top of restart() checks self.restart_task.is_some() and returns early, so only the first restart attempt succeeds.

This primarily affects debug adapters that advertise supportsRestartRequest dynamically via a CapabilitiesEvent after launch, such as the Flutter debug adapter.

Related: zed-extensions/dart#45

Before you mark this PR as ready for review, make sure that you have:

  • Added a solid test coverage and/or screenshots from doing manual testing
  • Done a self-review taking into account security and performance aspects
  • Aligned any UI changes with the UI checklist (N/A — no UI changes)

Release Notes:

  • debugger: Fixed debug session restart only working once when the adapter supports DAP restart requests.

`Session::restart_task` is set to `Some` when a restart is initiated but
never cleared back to `None`. The guard at the top of `restart()` checks
`self.restart_task.is_some()` and returns early, so only the first restart
attempt succeeds.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 11, 2026

We require contributors to sign our Contributor License Agreement, and we don't have @nelsoncampos-cloudwalk on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Mar 11, 2026
@nelsoncampos-cloudwalk
Copy link
Copy Markdown
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Mar 11, 2026
@cla-bot
Copy link
Copy Markdown

cla-bot bot commented Mar 11, 2026

The cla-bot has been summoned, and re-checked this pull request!

@nelsoncampos-cloudwalk
Copy link
Copy Markdown
Contributor Author

before:

after.mov

after:

before.mov

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@zed-industries-bot
Copy link
Copy Markdown
Contributor

Messages
📖

This PR includes links to the following GitHub Issues: #zed-extensions/dart#45
If this PR aims to close an issue, please include a Closes #ISSUE line at the top of the PR body.

Generated by 🚫 dangerJS against be02f1c

Copy link
Copy Markdown
Contributor

@Anthony-Eid Anthony-Eid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this bug and making a fix! I added a regression test to prevent this from happening in the future.

I'm going to enable auto merge 😀

@Anthony-Eid Anthony-Eid enabled auto-merge (squash) March 12, 2026 12:59
@Anthony-Eid Anthony-Eid merged commit 314b7e5 into zed-industries:main Mar 12, 2026
29 checks passed
@nelsoncampos-cloudwalk
Copy link
Copy Markdown
Contributor Author

nelsoncampos-cloudwalk commented Mar 12, 2026

Thanks for the quick review and merge! Happy to help 😀 Will make sure to include tests in future contributions.

tommyming pushed a commit to tommyming/zed that referenced this pull request Mar 13, 2026
…1247)

`Session::restart_task` is set to `Some` when a restart is initiated but
never cleared back to `None`. The guard at the top of `restart()` checks
`self.restart_task.is_some()` and returns early, so only the first
restart attempt succeeds.

This primarily affects debug adapters that advertise
`supportsRestartRequest` dynamically via a `CapabilitiesEvent` after
launch, such as the Flutter debug adapter.

Related: zed-extensions/dart#45

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
(N/A — no UI changes)

Release Notes:

- debugger: Fixed debug session restart only working once when the
adapter supports DAP restart requests.

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants