microsoft / microsoft/vscode-react-native

[Feature] Prevent getWSEndpoint from returning undefined

Open Beginner friendly
#2,929 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
2.7k
Forks
295
Avg merge
11h 17m
Merged PRs (30d)
24

Description

Description

DebuggerEndpointHelper.getWSEndpoint() treats the /json/list response as
DebuggableEndpointData[] without validating its contents.

When the response contains one or more targets but the selected target does not
have a valid webSocketDebuggerUrl, the method can return undefined despite
declaring a Promise<string> return type.

Actual behavior
The target list is non-empty, so the first item is selected and its missing
webSocketDebuggerUrl is returned as undefined.

This violates the method's Promise contract and can cause failures
later in the debugging flow.

Expected behavior
Only targets with a non-empty string webSocketDebuggerUrl should be considered
valid.

Invalid targets should be skipped.
The first valid target should be selected.
The existing Metro fallback should be attempted when the primary list has no
valid targets.
A clear error should be thrown when no valid target can be found.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating DebuggerEndpointHelper.getWSEndpoint and trace how the /json/list response and existing Metro fallback are handled. Verify behavior for invalid targets, selection of the first valid target, fallback when none are valid, and a clear error when no target can be found.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.