From cf599f9c3c6f6b5783e6da72268d0e1aac60aa0a Mon Sep 17 00:00:00 2001 From: Lorenzo Blasa Date: Wed, 13 Sep 2023 11:52:46 -0700 Subject: [PATCH] Move launch further down, temporarily Summary: Attempt to fix an ongoing issue whereas there's a race condition generating certificates Reviewed By: passy Differential Revision: D49237915 fbshipit-source-id: 2383b20cb6ba786166d5e70206b5fff846ed1211 --- .../certificate-exchange/certificate-utils.tsx | 6 ------ desktop/flipper-server/src/index.tsx | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/desktop/flipper-server-core/src/app-connectivity/certificate-exchange/certificate-utils.tsx b/desktop/flipper-server-core/src/app-connectivity/certificate-exchange/certificate-utils.tsx index bfbf62711..11beafd78 100644 --- a/desktop/flipper-server-core/src/app-connectivity/certificate-exchange/certificate-utils.tsx +++ b/desktop/flipper-server-core/src/app-connectivity/certificate-exchange/certificate-utils.tsx @@ -329,12 +329,6 @@ export const generateAuthToken = async () => { }; export const getAuthToken = async (): Promise => { - // Ensure we check for the validity of certificates before - // returning an authentication token. - // If the server certificates have expired, they will need - // to be renewed and will invalidate any existing token. - await ensureServerCertExists(); - if (!(await hasAuthToken())) { return generateAuthToken(); } diff --git a/desktop/flipper-server/src/index.tsx b/desktop/flipper-server/src/index.tsx index e5efd2d33..dc2e324bc 100644 --- a/desktop/flipper-server/src/index.tsx +++ b/desktop/flipper-server/src/index.tsx @@ -235,9 +235,6 @@ async function start() { `[flipper-server][bootstrap] FlipperServer created (${serverCreatedMS} ms)`, ); - // At this point, the HTTP server is ready and configuration is set. - await launch(); - const t6 = performance.now(); const launchedMS = t6 - t5; @@ -266,6 +263,9 @@ async function start() { } await flipperServer.connect(); + // At this point, the HTTP server is ready and configuration is set. + await launch(); + const t8 = performance.now(); const appServerStartedMS = t8 - t7; console.info(