diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index 3ac2a37b7..989cd73bc 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -28,6 +28,7 @@ import { loadLauncherSettings, loadProcessConfig, loadSettings, + sessionId, setupPrefetcher, startFlipperServer, startServer, @@ -39,7 +40,6 @@ import { Logger, parseEnvironmentVariables, setLoggerInstance, - uuid, wrapRequire, } from 'flipper-common'; import constants from './fb-stubs/constants'; @@ -167,7 +167,7 @@ async function getFlipperServer( const getEmbeddedServer = async () => { const server = new FlipperServerImpl( { - sessionId: uuid(), + sessionId, environmentInfo, env: parseEnvironmentVariables(env), gatekeepers: gatekeepers, diff --git a/desktop/flipper-dump/src/index.tsx b/desktop/flipper-dump/src/index.tsx index c5f8f9294..bf826c0a8 100644 --- a/desktop/flipper-dump/src/index.tsx +++ b/desktop/flipper-dump/src/index.tsx @@ -16,6 +16,7 @@ import { loadLauncherSettings, loadProcessConfig, loadSettings, + sessionId, } from 'flipper-server-core'; import { ClientDescription, @@ -23,7 +24,6 @@ import { DeviceDescription, setLoggerInstance, parseEnvironmentVariables, - uuid, } from 'flipper-common'; import path from 'path'; import {stdout} from 'process'; @@ -95,7 +95,7 @@ async function start(deviceQuery: string, appName: string, pluginId: string) { ]); const server = new FlipperServerImpl( { - sessionId: uuid(), + sessionId, environmentInfo, env: parseEnvironmentVariables(process.env), gatekeepers: {}, diff --git a/desktop/flipper-server-core/src/index.tsx b/desktop/flipper-server-core/src/index.tsx index 0edbf02fb..63d995ab3 100644 --- a/desktop/flipper-server-core/src/index.tsx +++ b/desktop/flipper-server-core/src/index.tsx @@ -28,3 +28,5 @@ export { getAuthToken, hasAuthToken, } from './app-connectivity/certificate-exchange/certificate-utils'; + +export {sessionId} from './sessionId'; diff --git a/desktop/flipper-server-core/src/server/startFlipperServer.tsx b/desktop/flipper-server-core/src/server/startFlipperServer.tsx index e6de71bee..25604ffe4 100644 --- a/desktop/flipper-server-core/src/server/startFlipperServer.tsx +++ b/desktop/flipper-server-core/src/server/startFlipperServer.tsx @@ -13,7 +13,6 @@ import { getLogger, FlipperServerType, EnvironmentInfo, - uuid, } from 'flipper-common'; import path from 'path'; import fs from 'fs-extra'; @@ -23,6 +22,7 @@ import {getGatekeepers} from '../gk'; import {loadLauncherSettings} from '../utils/launcherSettings'; import {loadProcessConfig} from '../utils/processConfig'; import {loadSettings} from '../utils/settings'; +import {sessionId} from '../sessionId'; /** * Creates an instance of FlipperServer (FlipperServerImpl). This is the @@ -59,7 +59,7 @@ export async function startFlipperServer( ]); return new FlipperServerImpl( { - sessionId: uuid(), + sessionId, environmentInfo, env: parseEnvironmentVariables(process.env), gatekeepers: getGatekeepers(environmentInfo.os.unixname), diff --git a/desktop/flipper-server-core/src/sessionId.tsx b/desktop/flipper-server-core/src/sessionId.tsx new file mode 100644 index 000000000..4df6f1020 --- /dev/null +++ b/desktop/flipper-server-core/src/sessionId.tsx @@ -0,0 +1,12 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + */ + +import {uuid} from 'flipper-common'; + +export const sessionId = uuid();