diff --git a/desktop/flipper-server/src/FlipperServerImpl.tsx b/desktop/flipper-server/src/FlipperServerImpl.tsx index 45d25b7a185..98f7374d3cc 100644 --- a/desktop/flipper-server/src/FlipperServerImpl.tsx +++ b/desktop/flipper-server/src/FlipperServerImpl.tsx @@ -685,7 +685,10 @@ export class FlipperServerImpl implements FlipperServer { const existing = this.devices.get(serial); if (existing) { // assert different kind of devices aren't accidentally reusing the same serial - if (Object.getPrototypeOf(existing) !== Object.getPrototypeOf(device)) { + if ( + existing.info.deviceType !== 'dummy' && + Object.getPrototypeOf(existing) !== Object.getPrototypeOf(device) + ) { throw new Error( `Tried to register a new device type for existing serial '${serial}': Trying to replace existing '${ Object.getPrototypeOf(existing).constructor.name diff --git a/desktop/flipper-ui/src/dispatcher/flipperServer.tsx b/desktop/flipper-ui/src/dispatcher/flipperServer.tsx index 5d4950067d9..8118cd6d23a 100644 --- a/desktop/flipper-ui/src/dispatcher/flipperServer.tsx +++ b/desktop/flipper-ui/src/dispatcher/flipperServer.tsx @@ -361,8 +361,11 @@ export function handleDeviceConnected( `Tried to replace still connected device '${existing.serial}' with a new instance.`, ); } - if (store.getState().settingsState.persistDeviceData) { - //Recycle device + if ( + existing.deviceType !== 'dummy' && + store.getState().settingsState.persistDeviceData + ) { + // Recycle device existing?.connected.set(true); store.dispatch({ type: 'SELECT_DEVICE',