Skip to content

Commit

Permalink
add appId as a standalone field (facebook#47098)
Browse files Browse the repository at this point in the history
Summary:

Changelog: [Internal]

D63329456 updated the `description` field to be human-readable.
Unfortunately, InspectorProxy relies on this field to compare the incoming `/open-debugger` calls.

hoxyq discovered the symptom of Fusebox failing to launch with `No compatible apps connected. React Native DevTools can only be used with the Hermes engine.` in Metro

Reviewed By: hoxyq

Differential Revision: D64547367
  • Loading branch information
EdmondChuiHW authored and facebook-github-bot committed Oct 17, 2024
1 parent 7168a9d commit 7de5268
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ describe('inspector proxy HTTP API', () => {
);
expect(json).toEqual([
{
appId: 'bar-app',
description: 'bar-app',
deviceName: 'foo',
devtoolsFrontendUrl: expect.any(String),
Expand All @@ -199,6 +200,7 @@ describe('inspector proxy HTTP API', () => {
webSocketDebuggerUrl: expect.any(String),
},
{
appId: 'bar-app',
description: 'bar-app',
deviceName: 'foo',
devtoolsFrontendUrl: expect.any(String),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export default class InspectorProxy implements InspectorProxyQueries {
id: `${deviceId}-${page.id}`,
title: page.title,
description: page.description ?? page.app,
appId: page.app,
type: 'node',
devtoolsFrontendUrl,
webSocketDebuggerUrl,
Expand Down
1 change: 1 addition & 0 deletions packages/dev-middleware/src/inspector-proxy/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export type MessageToDevice =
export type PageDescription = $ReadOnly<{
id: string,
title: string,
appId: string,
description: string,
type: string,
devtoolsFrontendUrl: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default function openDebuggerMiddleware({
target = targets.find(
_target =>
(targetId == null || _target.id === targetId) &&
(appId == null || _target.description === appId) &&
(appId == null || _target.appId === appId) &&
(device == null || _target.reactNative.logicalDeviceId === device),
);
} else if (targets.length > 0) {
Expand Down

0 comments on commit 7de5268

Please sign in to comment.