From 62863c8fe5a1a3d93f75bbfaf16591e9577c0832 Mon Sep 17 00:00:00 2001 From: Pritesh Nandgaonkar Date: Wed, 24 Mar 2021 13:11:43 -0700 Subject: [PATCH] Change the logic to check the cert exchange is needed or not Summary: It has been seen [here](https://fb.workplace.com/groups/flippersupport/permalink/1094276434386347/) that the user's app sandbox can be in a state where it might not have the device id information, but other app certificates. This causes the issue of "Timed out waiting for unknown device". We get the deviceid from flipper into app's sandbox when cert exchange happens. So if we don't have the device id information, we can again redo the cert exchange to get the sandbox in a state where flipper connects. Thus I updated the logic of `hasRequiredFiles` which checks the required files for cert exchange. Reviewed By: mweststrate Differential Revision: D27265693 fbshipit-source-id: ccf311f4728837ee9385c95c38f94c9c93380feb --- xplat/Flipper/ConnectionContextStore.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xplat/Flipper/ConnectionContextStore.cpp b/xplat/Flipper/ConnectionContextStore.cpp index bc0e059cdc6..a91f80a0fbd 100644 --- a/xplat/Flipper/ConnectionContextStore.cpp +++ b/xplat/Flipper/ConnectionContextStore.cpp @@ -37,8 +37,10 @@ bool ConnectionContextStore::hasRequiredFiles() { loadStringFromFile(absoluteFilePath(CLIENT_CERT_FILE_NAME)); std::string privateKey = loadStringFromFile(absoluteFilePath(PRIVATE_KEY_FILE)); + std::string config = + loadStringFromFile(absoluteFilePath(CONNECTION_CONFIG_FILE)); - if (caCert == "" || clientCert == "" || privateKey == "") { + if (caCert == "" || clientCert == "" || privateKey == "" || config == "") { return false; } return true;