From 73e3cfe4a1b9c1a7f0fd47be58e898ffbbca1d0d Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Tue, 25 Aug 2020 09:36:19 -0700 Subject: [PATCH] Minor Bug fixes Summary: With this change, I verified that our enterprise wilde app is able to connect to Flipper. Reviewed By: jknoxville Differential Revision: D23318335 fbshipit-source-id: cc952297ead1e8afcb1d9f5062e593e51e8ce893 --- desktop/app/src/server.tsx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/desktop/app/src/server.tsx b/desktop/app/src/server.tsx index 9edcd24e5..e622aa5fd 100644 --- a/desktop/app/src/server.tsx +++ b/desktop/app/src/server.tsx @@ -294,12 +294,7 @@ class Server extends EventEmitter { medium, } = clientData; const transformedMedium = transformCertificateExchangeMediumToType(medium); - const duplicateDevices = this.store - .getState() - .connections.devices.filter((device) => device.serial === device_id); - // When user switches from WWW to FS_ACCESS, we reset the certs folder, but we don't do it other way around. Thus when user switches to WWW from FS_ACCESS and if certs arepresent then the device id sent by Flipper SDK is the original one and in that case we need not create a device. - if (transformedMedium === 'WWW' && duplicateDevices.length == 0) { - // TODO unregister previous ClientDevice's for a particular device + if (transformedMedium === 'WWW') { this.store.dispatch({ type: 'REGISTER_DEVICE', payload: new ClientDevice(device_id, app, os), @@ -501,7 +496,8 @@ class Server extends EventEmitter { // try to get id by comparing giving `csr` to file from `csr_path` // otherwise, use given device_id const {csr_path, csr} = csrQuery; - return (csr_path && csr && query.medium === 'FS_ACCESS' + // For iOS we do not need to confirm the device id, as it never changes unlike android. + return (csr_path && csr && query.os != 'iOS' ? this.certificateProvider.extractAppNameFromCSR(csr).then((appName) => { return this.certificateProvider.getTargetDeviceId( query.os,