diff --git a/plugin-server/src/main/pluginsServer.ts b/plugin-server/src/main/pluginsServer.ts index d61f3bb5e0510..ac482ca21a6fa 100644 --- a/plugin-server/src/main/pluginsServer.ts +++ b/plugin-server/src/main/pluginsServer.ts @@ -15,6 +15,7 @@ import { CdpCyclotronWorker, CdpCyclotronWorkerFetch, CdpFunctionCallbackConsumer, + CdpInternalEventsConsumer, CdpProcessedEventsConsumer, } from '../cdp/cdp-consumers' import { defaultConfig } from '../config/config' @@ -451,6 +452,13 @@ export async function startPluginsServer( services.push(consumer.service) } + if (capabilities.cdpInternalEvents) { + const hub = await setupHub() + const consumer = new CdpInternalEventsConsumer(hub) + await consumer.start() + services.push(consumer.service) + } + if (capabilities.cdpFunctionCallbacks) { const hub = await setupHub() const consumer = new CdpFunctionCallbackConsumer(hub) diff --git a/plugin-server/src/types.ts b/plugin-server/src/types.ts index 47ac3764a3528..3b9d4e5ac593f 100644 --- a/plugin-server/src/types.ts +++ b/plugin-server/src/types.ts @@ -84,6 +84,7 @@ export enum PluginServerMode { recordings_blob_ingestion = 'recordings-blob-ingestion', recordings_blob_ingestion_overflow = 'recordings-blob-ingestion-overflow', cdp_processed_events = 'cdp-processed-events', + cdp_internal_events = 'cdp-internal-events', cdp_function_callbacks = 'cdp-function-callbacks', cdp_cyclotron_worker = 'cdp-cyclotron-worker', functional_tests = 'functional-tests', @@ -358,6 +359,7 @@ export interface PluginServerCapabilities { sessionRecordingBlobIngestion?: boolean sessionRecordingBlobOverflowIngestion?: boolean cdpProcessedEvents?: boolean + cdpInternalEvents?: boolean cdpFunctionCallbacks?: boolean cdpCyclotronWorker?: boolean appManagementSingleton?: boolean diff --git a/plugin-server/tests/cdp/cdp-internal-events-consumer.test.ts b/plugin-server/tests/cdp/cdp-internal-events-consumer.test.ts index 5039cf000c81e..b6df2267024fd 100644 --- a/plugin-server/tests/cdp/cdp-internal-events-consumer.test.ts +++ b/plugin-server/tests/cdp/cdp-internal-events-consumer.test.ts @@ -1,6 +1,5 @@ import { CdpInternalEventsConsumer } from '../../src/cdp/cdp-consumers' -import { HogWatcherState } from '../../src/cdp/hog-watcher' -import { HogFunctionInvocationGlobals, HogFunctionType } from '../../src/cdp/types' +import { HogFunctionType } from '../../src/cdp/types' import { Hub, Team } from '../../src/types' import { closeHub, createHub } from '../../src/utils/db/hub' import { getFirstTeam, resetTestDatabase } from '../helpers/sql'