diff --git a/desktop/app/src/init.tsx b/desktop/app/src/init.tsx index fcc51d684..3ac2a37b7 100644 --- a/desktop/app/src/init.tsx +++ b/desktop/app/src/init.tsx @@ -39,13 +39,13 @@ import { Logger, parseEnvironmentVariables, setLoggerInstance, + uuid, wrapRequire, } from 'flipper-common'; import constants from './fb-stubs/constants'; import {initializeElectron} from './electron/initializeElectron'; import path from 'path'; import fs from 'fs-extra'; -import os from 'os'; import {ElectronIpcClientRenderer} from './electronIpc'; import {KeytarModule} from 'flipper-server-core/src/utils/keytar'; import {initCompanionEnv} from 'flipper-server-companion'; @@ -167,6 +167,7 @@ async function getFlipperServer( const getEmbeddedServer = async () => { const server = new FlipperServerImpl( { + sessionId: uuid(), environmentInfo, env: parseEnvironmentVariables(env), gatekeepers: gatekeepers, diff --git a/desktop/flipper-common/src/server-types.tsx b/desktop/flipper-common/src/server-types.tsx index 7596c0f6d..dc320a744 100644 --- a/desktop/flipper-common/src/server-types.tsx +++ b/desktop/flipper-common/src/server-types.tsx @@ -524,6 +524,7 @@ export type FlipperServerConfig = { validWebSocketOrigins: string[]; environmentInfo: EnvironmentInfo; type?: FlipperServerType; + sessionId: string; }; export interface FlipperServerExecOptions { diff --git a/desktop/flipper-dump/src/index.tsx b/desktop/flipper-dump/src/index.tsx index 47fc82852..c5f8f9294 100644 --- a/desktop/flipper-dump/src/index.tsx +++ b/desktop/flipper-dump/src/index.tsx @@ -23,6 +23,7 @@ import { DeviceDescription, setLoggerInstance, parseEnvironmentVariables, + uuid, } from 'flipper-common'; import path from 'path'; import {stdout} from 'process'; @@ -94,6 +95,7 @@ async function start(deviceQuery: string, appName: string, pluginId: string) { ]); const server = new FlipperServerImpl( { + sessionId: uuid(), environmentInfo, env: parseEnvironmentVariables(process.env), gatekeepers: {}, diff --git a/desktop/flipper-server-core/src/server/startFlipperServer.tsx b/desktop/flipper-server-core/src/server/startFlipperServer.tsx index fc12b6e78..e6de71bee 100644 --- a/desktop/flipper-server-core/src/server/startFlipperServer.tsx +++ b/desktop/flipper-server-core/src/server/startFlipperServer.tsx @@ -13,6 +13,7 @@ import { getLogger, FlipperServerType, EnvironmentInfo, + uuid, } from 'flipper-common'; import path from 'path'; import fs from 'fs-extra'; @@ -58,6 +59,7 @@ export async function startFlipperServer( ]); return new FlipperServerImpl( { + sessionId: uuid(), environmentInfo, env: parseEnvironmentVariables(process.env), gatekeepers: getGatekeepers(environmentInfo.os.unixname), diff --git a/desktop/flipper-ui-core/src/reducers/application.tsx b/desktop/flipper-ui-core/src/reducers/application.tsx index 5c480ffaa..8a5957e36 100644 --- a/desktop/flipper-ui-core/src/reducers/application.tsx +++ b/desktop/flipper-ui-core/src/reducers/application.tsx @@ -7,7 +7,6 @@ * @format */ -import {v1 as uuidv1} from 'uuid'; import {getRenderHostInstance} from 'flipper-frontend-core'; import {Actions} from './'; @@ -44,7 +43,6 @@ export type State = { rightSidebarAvailable: boolean; windowIsFocused: boolean; share: ShareType | null; - sessionId: string | null; launcherMsg: LauncherMsg; statusMessages: Array; }; @@ -95,7 +93,6 @@ export const initialState: () => State = () => ({ windowIsFocused: getRenderHostInstance().hasFocus(), activeSheet: null, share: null, - sessionId: uuidv1(), launcherMsg: { severity: 'warning', message: '', diff --git a/desktop/scripts/jest-setup-after.tsx b/desktop/scripts/jest-setup-after.tsx index f2cc9e650..57a3066e7 100644 --- a/desktop/scripts/jest-setup-after.tsx +++ b/desktop/scripts/jest-setup-after.tsx @@ -22,6 +22,7 @@ import { ReleaseChannel, Tristate, parseEnvironmentVariables, + uuid, } from 'flipper-common'; // Only import the type! @@ -131,6 +132,7 @@ Object.defineProperty(global, 'matchMedia', { function createStubRenderHost(): RenderHost { const rootPath = resolve(__dirname, '..'); const stubConfig: FlipperServerConfig = { + sessionId: uuid(), environmentInfo: { processId: process.pid, appVersion: '0.0.0',