Skip to content

Blazor WASM: timed-out debugger connection can terminate a live attachment retry #9890

Open

Description

@ellahathaway

Description

Blazor WASM debugging can fail when js-debug times out an initial WebSocket connection and retries. Cleaning up the abandoned connection can terminate monovsdbg_wasm, breaking the live retry.

What happens

  1. js-debug abandons its first WebSocket opening attempt after two seconds and retries.
  2. Both attempts establish connections to the native debugger.
  3. If the abandoned attempt completes its native connection first, closing it can cause the native debugger to exit.
  4. The live retry then fails in CorDebugConnection.ReadHandshakeAsync.

Expected: Closing an abandoned opening attempt should not kill the debugger used by a live retry.

The exact fix ownership between VSWebAssemblyBridge and the native debugger still needs confirmation.

Reproduction and environment

Observed in real Windows x64 application-debugging runs with VS Code 1.130.0, C# 2.148.23, and .NET 11.

Also reproduced outside Aspire using the unmodified debugger/bridge, a simulated browser, and delayed WebSocket opening responses. Reversing the native connection order leaves the debugger alive.

The controlled reproduction also fails with C# 2.160.4 on Windows ARM64; that is not an x64 application-level result.

Evidence

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions