add appId as a standalone field (#47098)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47098

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

fbshipit-source-id: deed6851f3ede2c74be2b492def1eba6e58c43e6
This commit is contained in:
Edmond Chui
2024-10-17 12:47:05 -07:00
committed by Facebook GitHub Bot
parent 1d6ac09530
commit 0d591d9dc3
4 changed files with 5 additions and 1 deletions
@@ -185,6 +185,7 @@ describe('inspector proxy HTTP API', () => {
);
expect(json).toEqual([
{
appId: 'bar-app',
description: 'bar-app',
deviceName: 'foo',
devtoolsFrontendUrl: expect.any(String),
@@ -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),
@@ -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,
@@ -115,6 +115,7 @@ export type MessageToDevice =
export type PageDescription = $ReadOnly<{
id: string,
title: string,
appId: string,
description: string,
type: string,
devtoolsFrontendUrl: string,
@@ -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) {