From ec9e3aeb6e60973ce668ff516fc3ba8d969ccd02 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 22 Oct 2021 11:24:58 -0700 Subject: [PATCH] Filter out OS devices when finding valid clients Summary: When running debug builds, and not specifying a `device=...` qualifier as part of the deeplink, you'd get stuck on the "waiting for plugin to be launched" dialogue as Flipper would accept the local MacOS (or Windows, ...) connection as a valid client which can be quite confusing. Reviewed By: mweststrate Differential Revision: D31857737 fbshipit-source-id: ff568544f660c51e17b40c2aaadf058588746ef9 --- .../src/dispatcher/handleOpenPluginDeeplink.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx b/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx index f8ad0b2c1..d27bcf420 100644 --- a/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx +++ b/desktop/app/src/dispatcher/handleOpenPluginDeeplink.tsx @@ -452,12 +452,17 @@ async function selectDevicesAndClient( ): Promise { function findValidDevices() { // find connected devices with the right OS. - return store - .getState() - .connections.devices.filter((d) => d.connected.get()) - .filter( - (d) => params.devices.length === 0 || params.devices.includes(d.os), - ); + return ( + store + .getState() + .connections.devices.filter((d) => d.connected.get()) + .filter( + (d) => params.devices.length === 0 || params.devices.includes(d.os), + ) + // This filters out OS-level devices which are causing more confusion than good + // when used with deeplinks. + .filter(canBeDefaultDevice) + ); } // loop until we have devices (or abort)