This repository has been archived by the owner on Jul 31, 2023. It is now read-only.
fix: when a setBreakpoint request comes in, always respond only once #688
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.
Description of change and why it was needed here
Fixes #510 and #657
This fixes a notorious bug that engineers at Stripe encounter daily: The debugger fails to attach because they have a breakpoint that is unset in a file.
Specifically, the situation occurs when VS Code has one file open that has all unset breakpoints (e.g., there are no active breakpoints in the file). It turns out that VS Code sends out a
setBreakpoints
request with no breakpoints for this file. In this case, the Ruby debug adapter's code would not send a response to this request, so VS Code would wait forever for a response that would never come.I've updated the code to ensure that it always responds once to this sort of request, and fixes another bug where I think it might respond twice to a single setBreakpoints request.