Skip to content

DAP: a bound breakpoint is shown as invalid when another session of the tree answers verified=false last #1898

Closed

Description

@leotimus

I found this one in August too, right after a local fix for #1897: with the session kept
alive, a breakpoint that had hit showed the red "invalid" icon and still hit.

Same setup as #1897. Set a line breakpoint in app.js at the first line that runs.

Expected: the breakpoint shows as verified while the session of the page has it bound.

Actual: it often shows the red "invalid" icon with "Unbound breakpoint", but it still hits.
The result depends on the order of the answers.

What js-debug sends

DAPBreakpointHandlerBase
sends each breakpoint to every session. Only the session of the page binds it. In the trace of the
page from #1897, the answer of another session comes after the bind:

0.55s root    setBreakpoints answer: verified=False 'breakpoint.provisionalBreakpoint'  (never changes)
0.55s child1  setBreakpoints answer: verified=False 'breakpoint.provisionalBreakpoint'
0.60s child2  setBreakpoints answer: verified=False 'breakpoint.provisionalBreakpoint'
0.60s child1  event breakpoint changed: verified=True
0.60s child3  setBreakpoints answer: verified=False 'breakpoint.provisionalBreakpoint'   <- last

Cause

BreakpointHandlerBase.updateBreakpoint()
applies each answer as it comes, so the last answer wins.

A test in DAPBreakpointHandlerBaseTest shows it: one server binds the breakpoint, and then
another server answers verified=false. On main:

testBreakpointBoundByOneSessionStaysVerified
junit.framework.ComparisonFailure: expected:<[verified]> but was:<[invalid: Unbound breakpoint]>

Suggested fix

Keep the answers per DAP server for each breakpoint: verified while at least one server reports
it bound, and invalid only when none does. Forget a server's answers when its session
terminates. This covers line, function and data breakpoints. The callers then pass the server
that answered: the setBreakpoints responses and the breakpoint "changed" event.

If you agree, I can include it in the same PR, with the test above.


AI/tooling disclosure: I found this bug while working, and I used Claude Code for the analysis,
the fix and the test. I reviewed the result and understand the problem.

Activity

  1. angelozerr commented on Nov 9, 2026

    @angelozerr
    Contributor

    @leotimus please create a PR

  2. added
    bug
    dap
    on Nov 9, 2026
  3. added this to the 0.30.0 milestone on Nov 9, 2026
  4. moved this to In Progress in Java Toolingon Nov 9, 2026
  5. added a commit that references this issue on Nov 11, 2026
    8281b86
  6. added 3 commits that reference this issue on Nov 11, 2026
    b130ef8
    a042dbf
    23106d6
  7. moved this from In Progress to Done in Java Toolingon Nov 13, 2026
  8. added 2 commits that reference this issue on Nov 13, 2026
    be72bf3
    bde5e69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdap

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions