From 8af1e816bcaed3ce484c4b1d2e8fd9674f1a4af0 Mon Sep 17 00:00:00 2001 From: John Knox Date: Fri, 19 Nov 2021 03:35:31 -0800 Subject: [PATCH] Fix client-switching bug Summary: When a new client connects, we dispatch the NEW_CLIENT event. The reducer of this event contains logic for determining if flipper should switch to display the newly connected client or not, and if so, it will dispatch SELECT_CLIENT. For that reason, flipperServer always dispatching SELECT_CLIENT bypasses the "should switch?" logic and always switches whenever a new client connects. This is disruptive to working and not desired. Removing this dispatch so that we rely on the NEW_CLIENT reducer to decide. Bug report: https://fb.workplace.com/groups/flippersupport/posts/1255964631550859 Reviewed By: aigoncharov Differential Revision: D32532942 fbshipit-source-id: 0ff2693745e37378362254053ae5fd6fc0d11de2 --- desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx index 688ce5869..22cdd9857 100644 --- a/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx +++ b/desktop/flipper-ui-core/src/dispatcher/flipperServer.tsx @@ -244,8 +244,6 @@ export async function handleClientConnected( payload: client, }); - store.dispatch(selectClient(client.id)); - await timeout( 30 * 1000, client.init(),