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
This commit is contained in:
John Knox
2021-11-19 03:35:31 -08:00
committed by Facebook GitHub Bot
parent 0383d33aab
commit 8af1e816bc

View File

@@ -244,8 +244,6 @@ export async function handleClientConnected(
payload: client,
});
store.dispatch(selectClient(client.id));
await timeout(
30 * 1000,
client.init(),