diff --git a/.eslintrc.js b/.eslintrc.js index d982339d338..fa36af54fc9 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -42,7 +42,7 @@ module.exports = { }, plugins: [ 'react', - "react-hooks", + 'react-hooks', 'cypress', '@typescript-eslint', 'compat', @@ -52,8 +52,8 @@ module.exports = { 'unused-imports', ], rules: { - "react-hooks/rules-of-hooks": "error", - "react-hooks/exhaustive-deps": "warn", + 'react-hooks/rules-of-hooks': 'error', + 'react-hooks/exhaustive-deps': 'warn', // PyCharm always adds curly braces, I guess vscode doesn't, PR reviewers often complain they are present on props that don't need them // let's save the humans time and let the machines do the work // "never" means if the prop does not need the curly braces, they will be removed/errored @@ -116,7 +116,7 @@ module.exports = { { name: 'dayjs', message: 'Do not directly import dayjs. Only import the dayjs exported from lib/dayjs.', - } + }, ], }, ], @@ -282,8 +282,8 @@ module.exports = { node: true, 'jest/globals': true, }, - "plugins": ["jest"], - "extends": ["plugin:jest/recommended"], + plugins: ['jest'], + extends: ['plugin:jest/recommended'], globals: { ...globals, given: 'readonly', @@ -310,8 +310,8 @@ module.exports = { node: true, 'jest/globals': true, }, - "plugins": ["jest"], - "extends": ["plugin:jest/recommended"], + plugins: ['jest'], + extends: ['plugin:jest/recommended'], globals: { ...globals, given: 'readonly', @@ -320,7 +320,7 @@ module.exports = { // don't complain about unknown expect statements 'jest/valid-expect': 'off', // don't warn about missing expect - 'jest/expect-expect': 'off' + 'jest/expect-expect': 'off', }, }, { diff --git a/.prettierignore b/.prettierignore index 384440856b3..121a272bb0b 100644 --- a/.prettierignore +++ b/.prettierignore @@ -18,3 +18,5 @@ node_modules/ pnpm-lock.yaml posthog/templates/email/* hogvm/typescript/src/stl/bytecode.ts +rust/ +livestream/ diff --git a/.storybook/test-runner.ts b/.storybook/test-runner.ts index 5b6a41786ea..a5f81f95f58 100644 --- a/.storybook/test-runner.ts +++ b/.storybook/test-runner.ts @@ -263,10 +263,10 @@ async function expectLocatorToMatchStorySnapshot( * as it doesn't work with local Storybook (the live reload feature keeps up a long-running request, so we aren't idle). */ async function waitForPageReady(page: Page): Promise { - await page.waitForLoadState("domcontentloaded"); - await page.waitForLoadState("load"); + await page.waitForLoadState('domcontentloaded') + await page.waitForLoadState('load') if (process.env.CI) { - await page.waitForLoadState("networkidle"); + await page.waitForLoadState('networkidle') } - await page.evaluate(() => document.fonts.ready); + await page.evaluate(() => document.fonts.ready) } diff --git a/babel.config.js b/babel.config.js index fda60af4e80..9ac6115b798 100644 --- a/babel.config.js +++ b/babel.config.js @@ -2,7 +2,7 @@ module.exports = { plugins: [ '@babel/plugin-transform-runtime', - "@babel/plugin-transform-class-properties", + '@babel/plugin-transform-class-properties', '@babel/plugin-transform-private-property-in-object', '@babel/plugin-transform-nullish-coalescing-operator', ], diff --git a/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--dark.png b/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--dark.png index 97d72dcec86..c8cd83be7e7 100644 Binary files a/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--dark.png and b/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--dark.png differ diff --git a/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--light.png b/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--light.png index 0804b690eea..e8fe754ac07 100644 Binary files a/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--light.png and b/frontend/__snapshots__/scenes-other-settings--settings-project-with-replay-features--light.png differ diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx index 169bd66f1e5..294f429fd8e 100644 --- a/frontend/src/lib/constants.tsx +++ b/frontend/src/lib/constants.tsx @@ -218,7 +218,6 @@ export const FEATURE_FLAGS = { ENVIRONMENTS: 'environments', // owner: @Twixes #team-product-analytics BILLING_PAYMENT_ENTRY_IN_APP: 'billing-payment-entry-in-app', // owner: @zach LEGACY_ACTION_WEBHOOKS: 'legacy-action-webhooks', // owner: @mariusandra #team-cdp - SESSION_REPLAY_URL_TRIGGER: 'session-replay-url-trigger', // owner: @richard-better #team-replay REPLAY_TEMPLATES: 'replay-templates', // owner: @raquelmsmith #team-replay EXPERIMENTS_HOGQL: 'experiments-hogql', // owner: @jurajmajerik #team-experiments ROLE_BASED_ACCESS_CONTROL: 'role-based-access-control', // owner: @zach diff --git a/frontend/src/scenes/settings/environment/SessionRecordingIngestionSettings.tsx b/frontend/src/scenes/settings/environment/SessionRecordingIngestionSettings.tsx index 099985d0b0e..fc2e0cbf7ce 100644 --- a/frontend/src/scenes/settings/environment/SessionRecordingIngestionSettings.tsx +++ b/frontend/src/scenes/settings/environment/SessionRecordingIngestionSettings.tsx @@ -12,9 +12,11 @@ import { import clsx from 'clsx' import { useActions, useValues } from 'kea' import { Form } from 'kea-forms' +import { EventSelect } from 'lib/components/EventSelect/EventSelect' import { FlaggedFeature } from 'lib/components/FlaggedFeature' import { FlagSelector } from 'lib/components/FlagSelector' import { PayGateMini } from 'lib/components/PayGateMini/PayGateMini' +import { TaxonomicFilterGroupType } from 'lib/components/TaxonomicFilter/types' import { FEATURE_FLAGS, SESSION_REPLAY_MINIMUM_DURATION_OPTIONS } from 'lib/constants' import { IconCancel } from 'lib/lemon-ui/icons' import { LemonField } from 'lib/lemon-ui/LemonField' @@ -320,6 +322,35 @@ function UrlBlocklistOptions(): JSX.Element | null { ) } +function EventTriggerOptions(): JSX.Element | null { + const { eventTriggerConfig } = useValues(sessionReplayIngestionControlLogic) + const { updateEventTriggerConfig } = useActions(sessionReplayIngestionControlLogic) + + return ( +
+
+ Event emitted +
+

+ Session recording will be started immediately before PostHog queues any of these events to be sent to + the backend. +

+ { + updateEventTriggerConfig(includedEvents) + }} + selectedEvents={eventTriggerConfig ?? []} + addElement={ + } sideIcon={null}> + Add event + + } + /> +
+ ) +} + export function SessionRecordingIngestionSettings(): JSX.Element | null { const { updateCurrentTeam } = useActions(teamLogic) const { currentTeam } = useValues(teamLogic) @@ -474,11 +505,10 @@ export function SessionRecordingIngestionSettings(): JSX.Element | null { )} - - - + + diff --git a/frontend/src/scenes/settings/environment/sessionReplayIngestionControlLogic.ts b/frontend/src/scenes/settings/environment/sessionReplayIngestionControlLogic.ts index 61bc2056749..9432c128ac6 100644 --- a/frontend/src/scenes/settings/environment/sessionReplayIngestionControlLogic.ts +++ b/frontend/src/scenes/settings/environment/sessionReplayIngestionControlLogic.ts @@ -39,6 +39,8 @@ export const sessionReplayIngestionControlLogic = kea ({ originalIndex }), newUrlBlocklist: true, cancelProposingUrlBlocklist: true, + setEventTriggerConfig: (eventTriggerConfig: string[]) => ({ eventTriggerConfig }), + updateEventTriggerConfig: (eventTriggerConfig: string[]) => ({ eventTriggerConfig }), }), connect({ values: [teamLogic, ['currentTeam']], actions: [teamLogic, ['updateCurrentTeam']] }), reducers({ @@ -103,6 +105,13 @@ export const sessionReplayIngestionControlLogic = kea null, }, ], + eventTriggerConfig: [ + null as string[] | null, + { + setEventTriggerConfig: (_, { eventTriggerConfig }) => eventTriggerConfig, + updateEventTriggerConfig: (_, { eventTriggerConfig }) => eventTriggerConfig, + }, + ], }), props({}), loaders(({ values }) => ({ @@ -183,6 +192,7 @@ export const sessionReplayIngestionControlLogic = kea { actions.setUrlTriggerConfig(currentTeam?.session_recording_url_trigger_config ?? []) actions.setUrlBlocklistConfig(currentTeam?.session_recording_url_blocklist_config ?? []) + actions.setEventTriggerConfig(currentTeam?.session_recording_event_trigger_config ?? []) }, })), forms(({ values, actions }) => ({ @@ -243,5 +253,11 @@ export const sessionReplayIngestionControlLogic = kea { + actions.setEventTriggerConfig(eventTriggerConfig) + await teamLogic.asyncActions.updateCurrentTeam({ + session_recording_event_trigger_config: eventTriggerConfig, + }) + }, })), ]) diff --git a/frontend/src/scenes/teamActivityDescriber.tsx b/frontend/src/scenes/teamActivityDescriber.tsx index 4d6b51b2ff4..bc08596af9a 100644 --- a/frontend/src/scenes/teamActivityDescriber.tsx +++ b/frontend/src/scenes/teamActivityDescriber.tsx @@ -59,6 +59,17 @@ const teamActionsMapping: Record< description: [<>Changed session replay URL blocklist], } }, + session_recording_event_trigger_config(change: ActivityChange | undefined): ChangeMapping | null { + const before = change?.before + const after = change?.after + if (before === null && after === null) { + return null + } + + return { + description: [<>Changed session replay event triggers], + } + }, capture_console_log_opt_in(change: ActivityChange | undefined): ChangeMapping | null { return { description: [<>{change?.after ? 'enabled' : 'disabled'} console log capture in session replay] } }, diff --git a/frontend/src/types.ts b/frontend/src/types.ts index f1e56daa3db..21718ba6c79 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -521,6 +521,7 @@ export interface TeamType extends TeamBasicType { autocapture_web_vitals_allowed_metrics?: SupportedWebVitalsMetrics[] session_recording_url_trigger_config?: SessionReplayUrlTriggerConfig[] session_recording_url_blocklist_config?: SessionReplayUrlTriggerConfig[] + session_recording_event_trigger_config?: string[] surveys_opt_in?: boolean heatmaps_opt_in?: boolean autocapture_exceptions_errors_to_ignore: string[] diff --git a/posthog/api/decide.py b/posthog/api/decide.py index 43344ef1753..1d1a2383a9e 100644 --- a/posthog/api/decide.py +++ b/posthog/api/decide.py @@ -369,6 +369,7 @@ def _session_recording_config_response(request: HttpRequest, team: Team, token: "networkPayloadCapture": team.session_recording_network_payload_capture_config or None, "urlTriggers": team.session_recording_url_trigger_config, "urlBlocklist": team.session_recording_url_blocklist_config, + "eventTriggers": team.session_recording_event_trigger_config, } if isinstance(team.session_replay_config, dict): diff --git a/posthog/api/team.py b/posthog/api/team.py index 70e0bd41993..6a948e002ec 100644 --- a/posthog/api/team.py +++ b/posthog/api/team.py @@ -129,6 +129,7 @@ class CachingTeamSerializer(serializers.ModelSerializer): "session_recording_network_payload_capture_config", "session_recording_url_trigger_config", "session_recording_url_blocklist_config", + "session_recording_event_trigger_config", "session_replay_config", "survey_config", "recording_domains", @@ -185,6 +186,7 @@ class TeamSerializer(serializers.ModelSerializer, UserPermissionsSerializerMixin "session_recording_network_payload_capture_config", "session_recording_url_trigger_config", "session_recording_url_blocklist_config", + "session_recording_event_trigger_config", "session_replay_config", "survey_config", "effective_membership_level", diff --git a/posthog/api/test/__snapshots__/test_action.ambr b/posthog/api/test/__snapshots__/test_action.ambr index 46eddf801ce..d92da4aaf17 100644 --- a/posthog/api/test/__snapshots__/test_action.ambr +++ b/posthog/api/test/__snapshots__/test_action.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -154,6 +155,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -480,6 +482,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_annotation.ambr b/posthog/api/test/__snapshots__/test_annotation.ambr index dd57e01fcec..d7871ab1851 100644 --- a/posthog/api/test/__snapshots__/test_annotation.ambr +++ b/posthog/api/test/__snapshots__/test_annotation.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -122,6 +123,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -381,6 +383,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_decide.ambr b/posthog/api/test/__snapshots__/test_decide.ambr index a4c00e90033..39c5cf35574 100644 --- a/posthog/api/test/__snapshots__/test_decide.ambr +++ b/posthog/api/test/__snapshots__/test_decide.ambr @@ -1,7 +1,4 @@ # serializer version: 1 -# name: TestDatabaseCheckForDecide.test_decide_doesnt_error_out_when_database_is_down_and_database_check_isnt_cached - 'SELECT 1' -# --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down ''' SELECT "posthog_user"."id", @@ -161,77 +158,6 @@ AND "posthog_pluginconfig"."team_id" = 99999) ''' # --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.15 - ''' - SELECT "posthog_user"."id", - "posthog_user"."password", - "posthog_user"."last_login", - "posthog_user"."first_name", - "posthog_user"."last_name", - "posthog_user"."is_staff", - "posthog_user"."date_joined", - "posthog_user"."uuid", - "posthog_user"."current_organization_id", - "posthog_user"."current_team_id", - "posthog_user"."email", - "posthog_user"."pending_email", - "posthog_user"."temporary_token", - "posthog_user"."distinct_id", - "posthog_user"."is_email_verified", - "posthog_user"."has_seen_product_intro_for", - "posthog_user"."strapi_id", - "posthog_user"."is_active", - "posthog_user"."theme_mode", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."hedgehog_config", - "posthog_user"."events_column_config", - "posthog_user"."email_opt_in" - FROM "posthog_user" - WHERE "posthog_user"."id" = 2 - LIMIT 21 - ''' -# --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.16 - ''' - SELECT "posthog_featureflag"."id", - "posthog_featureflag"."key", - "posthog_featureflag"."name", - "posthog_featureflag"."filters", - "posthog_featureflag"."rollout_percentage", - "posthog_featureflag"."team_id", - "posthog_featureflag"."created_by_id", - "posthog_featureflag"."created_at", - "posthog_featureflag"."deleted", - "posthog_featureflag"."active", - "posthog_featureflag"."rollback_conditions", - "posthog_featureflag"."performed_rollback", - "posthog_featureflag"."ensure_experience_continuity", - "posthog_featureflag"."usage_dashboard_id", - "posthog_featureflag"."has_enriched_analytics" - FROM "posthog_featureflag" - WHERE ("posthog_featureflag"."active" - AND NOT "posthog_featureflag"."deleted" - AND "posthog_featureflag"."team_id" = 2) - ''' -# --- -# name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.17 - ''' - SELECT "posthog_pluginconfig"."id", - "posthog_pluginconfig"."web_token", - "posthog_pluginsourcefile"."updated_at", - "posthog_plugin"."updated_at", - "posthog_pluginconfig"."updated_at" - FROM "posthog_pluginconfig" - INNER JOIN "posthog_plugin" ON ("posthog_pluginconfig"."plugin_id" = "posthog_plugin"."id") - INNER JOIN "posthog_pluginsourcefile" ON ("posthog_plugin"."id" = "posthog_pluginsourcefile"."plugin_id") - WHERE ("posthog_pluginconfig"."enabled" - AND "posthog_pluginsourcefile"."filename" = 'site.ts' - AND "posthog_pluginsourcefile"."status" = 'TRANSPILED' - AND "posthog_pluginconfig"."team_id" = 2) - ''' -# --- # name: TestDecide.test_decide_doesnt_error_out_when_database_is_down.2 ''' SELECT "posthog_team"."id", @@ -270,6 +196,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -431,6 +358,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -509,6 +437,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -590,6 +519,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -692,6 +622,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -853,6 +784,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -955,6 +887,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1121,6 +1054,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1241,6 +1175,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_early_access_feature.ambr b/posthog/api/test/__snapshots__/test_early_access_feature.ambr index d09e131bdbf..7e33fb1c9d1 100644 --- a/posthog/api/test/__snapshots__/test_early_access_feature.ambr +++ b/posthog/api/test/__snapshots__/test_early_access_feature.ambr @@ -28,6 +28,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -175,6 +176,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_element.ambr b/posthog/api/test/__snapshots__/test_element.ambr index f907d5fe6bc..d6bceb987c7 100644 --- a/posthog/api/test/__snapshots__/test_element.ambr +++ b/posthog/api/test/__snapshots__/test_element.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_feature_flag.ambr b/posthog/api/test/__snapshots__/test_feature_flag.ambr index 451d10a0057..d8c23601366 100644 --- a/posthog/api/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_feature_flag.ambr @@ -469,6 +469,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -682,6 +683,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1055,6 +1057,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1201,6 +1204,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1506,6 +1510,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1628,6 +1633,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1704,6 +1710,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1773,6 +1780,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_insight.ambr b/posthog/api/test/__snapshots__/test_insight.ambr index b87866ba26a..0245b9c88b4 100644 --- a/posthog/api/test/__snapshots__/test_insight.ambr +++ b/posthog/api/test/__snapshots__/test_insight.ambr @@ -699,6 +699,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -761,6 +762,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -900,6 +902,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1151,6 +1154,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1308,6 +1312,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1452,6 +1457,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1575,6 +1581,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1733,6 +1740,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1830,6 +1838,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1927,6 +1936,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1996,6 +2006,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr index 5ad65068a8e..30111532713 100644 --- a/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr +++ b/posthog/api/test/__snapshots__/test_organization_feature_flag.ambr @@ -109,6 +109,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -226,6 +227,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -323,6 +325,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -392,6 +395,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -540,6 +544,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -609,6 +614,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -706,6 +712,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -775,6 +782,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -937,6 +945,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1029,6 +1038,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1479,6 +1489,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2178,6 +2189,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_preflight.ambr b/posthog/api/test/__snapshots__/test_preflight.ambr index c4e3fac86d8..79fbf5392e6 100644 --- a/posthog/api/test/__snapshots__/test_preflight.ambr +++ b/posthog/api/test/__snapshots__/test_preflight.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/__snapshots__/test_survey.ambr b/posthog/api/test/__snapshots__/test_survey.ambr index 8ab0b2d3c33..6cc212d2859 100644 --- a/posthog/api/test/__snapshots__/test_survey.ambr +++ b/posthog/api/test/__snapshots__/test_survey.ambr @@ -175,6 +175,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr index 70297f25701..12d1f6f8fff 100644 --- a/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr +++ b/posthog/api/test/dashboards/__snapshots__/test_dashboard.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -201,6 +202,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -406,6 +408,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -733,6 +736,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1127,6 +1131,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1196,6 +1201,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1369,6 +1375,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1431,6 +1438,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1570,6 +1578,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1691,6 +1700,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1902,6 +1912,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2129,6 +2140,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2226,6 +2238,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2323,6 +2336,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2392,6 +2406,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2493,6 +2508,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2594,6 +2610,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2767,6 +2784,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2886,6 +2904,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2983,6 +3002,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3080,6 +3100,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3149,6 +3170,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3226,6 +3248,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3365,6 +3388,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3486,6 +3510,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3705,6 +3730,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3910,6 +3936,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4077,6 +4104,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4267,6 +4295,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4742,6 +4771,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4864,6 +4894,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5045,6 +5076,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5189,6 +5221,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5297,6 +5330,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5394,6 +5428,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5463,6 +5498,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5532,6 +5568,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5671,6 +5708,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5766,6 +5804,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5835,6 +5874,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5974,6 +6014,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6095,6 +6136,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6294,6 +6336,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6413,6 +6456,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6524,6 +6568,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6621,6 +6666,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6690,6 +6736,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6759,6 +6806,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6898,6 +6946,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7026,6 +7075,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7213,6 +7263,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7307,6 +7358,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7401,6 +7453,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7498,6 +7551,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7595,6 +7649,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7664,6 +7719,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7733,6 +7789,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7886,6 +7943,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8007,6 +8065,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8205,6 +8264,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8410,6 +8470,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8595,6 +8656,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8808,6 +8870,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -8909,6 +8972,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -9090,6 +9154,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -9286,6 +9351,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -9408,6 +9474,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -9589,6 +9656,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -9883,6 +9951,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr index 5cb3551f45e..2105778e1cf 100644 --- a/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr +++ b/posthog/api/test/notebooks/__snapshots__/test_notebook.ambr @@ -60,6 +60,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -154,6 +155,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -432,6 +434,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -538,6 +541,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/api/test/test_decide.py b/posthog/api/test/test_decide.py index 7532c3405d2..99a1a031c08 100644 --- a/posthog/api/test/test_decide.py +++ b/posthog/api/test/test_decide.py @@ -52,6 +52,22 @@ from posthog.test.base import ( ) +def make_session_recording_config(overrides: dict | None = None) -> dict: + return { + "endpoint": "/s/", + "recorderVersion": "v2", + "consoleLogRecordingEnabled": True, + "sampleRate": None, + "linkedFlag": None, + "minimumDurationMilliseconds": None, + "networkPayloadCapture": None, + "urlTriggers": [], + "urlBlocklist": [], + "eventTriggers": [], + **(overrides or {}), + } + + @patch( "posthog.models.feature_flag.flag_matching.postgres_healthcheck.is_connected", return_value=True, @@ -166,17 +182,7 @@ class TestDecide(BaseTest, QueryMatchingTest): self._update_team({"session_recording_opt_in": True}) response = self._post_decide().json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() self.assertEqual(response["supportedCompression"], ["gzip", "gzip-js"]) def test_user_console_log_opt_in(self, *args): @@ -187,17 +193,7 @@ class TestDecide(BaseTest, QueryMatchingTest): self._update_team({"session_recording_opt_in": True, "capture_console_log_opt_in": True}) response = self._post_decide().json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() def test_user_performance_opt_in(self, *args): # :TRICKY: Test for regression around caching @@ -323,17 +319,11 @@ class TestDecide(BaseTest, QueryMatchingTest): ) response = self._post_decide(origin="capacitor://localhost:8000/home").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [{"url": "/replay-examples/", "matching": "regex"}], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config( + { + "urlTriggers": [{"url": "/replay-examples/", "matching": "regex"}], + } + ) def test_session_recording_url_blocklist_patterns(self, *args): self._update_team( @@ -344,17 +334,24 @@ class TestDecide(BaseTest, QueryMatchingTest): ) response = self._post_decide(origin="capacitor://localhost:8000/home").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [{"url": "/replay-examples/iframe", "matching": "regex"}], - } + assert response["sessionRecording"] == make_session_recording_config( + { + "urlBlocklist": [{"url": "/replay-examples/iframe", "matching": "regex"}], + } + ) + + def test_session_recording_event_triggers(self, *args): + self._update_team( + { + "session_recording_event_trigger_config": ["$pageview", "$exception"], + "session_recording_opt_in": True, + } + ) + + response = self._post_decide(origin="capacitor://localhost:8000/home").json() + assert response["sessionRecording"] == make_session_recording_config( + {"eventTriggers": ["$pageview", "$exception"]} + ) def test_session_recording_network_payload_capture_config(self, *args): # :TRICKY: Test for regression around caching @@ -476,17 +473,7 @@ class TestDecide(BaseTest, QueryMatchingTest): ) response = self._post_decide(origin="https://random.example.com").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() self.assertEqual(response["supportedCompression"], ["gzip", "gzip-js"]) # Make sure the domain matches exactly @@ -505,17 +492,7 @@ class TestDecide(BaseTest, QueryMatchingTest): assert response["sessionRecording"] is False response = self._post_decide(origin="https://example.com").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() def test_user_autocapture_opt_out(self, *args): # :TRICKY: Test for regression around caching @@ -551,49 +528,19 @@ class TestDecide(BaseTest, QueryMatchingTest): self._update_team({"session_recording_opt_in": True, "recording_domains": []}) response = self._post_decide(origin="any.site.com").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() def test_user_session_recording_allowed_for_android(self, *args) -> None: self._update_team({"session_recording_opt_in": True, "recording_domains": ["https://my-website.io"]}) response = self._post_decide(origin="any.site.com", user_agent="posthog-android/3.1.0").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() def test_user_session_recording_allowed_for_ios(self, *args) -> None: self._update_team({"session_recording_opt_in": True, "recording_domains": ["https://my-website.io"]}) response = self._post_decide(origin="any.site.com", user_agent="posthog-ios/3.1.0").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() def test_user_session_recording_allowed_when_permitted_domains_are_not_http_based(self, *args): self._update_team( @@ -604,17 +551,7 @@ class TestDecide(BaseTest, QueryMatchingTest): ) response = self._post_decide(origin="capacitor://localhost:8000/home").json() - assert response["sessionRecording"] == { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": None, - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - } + assert response["sessionRecording"] == make_session_recording_config() @snapshot_postgres_queries def test_web_app_queries(self, *args): @@ -2969,20 +2906,12 @@ class TestDecide(BaseTest, QueryMatchingTest): response = self._post_decide(api_version=2, origin="https://random.example.com").json() - self.assertEqual( - response["sessionRecording"], + assert response["sessionRecording"] == make_session_recording_config( { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, "sampleRate": "0.20", - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - }, + } ) + self.assertEqual(response["supportedCompression"], ["gzip", "gzip-js"]) self.assertEqual(response["siteApps"], []) self.assertEqual( @@ -2999,20 +2928,12 @@ class TestDecide(BaseTest, QueryMatchingTest): with connection.execute_wrapper(QueryTimeoutWrapper()): response = self._post_decide(api_version=2, origin="https://random.example.com").json() - self.assertEqual( - response["sessionRecording"], + assert response["sessionRecording"] == make_session_recording_config( { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, "sampleRate": "0.20", - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - }, + } ) + self.assertEqual(response["supportedCompression"], ["gzip", "gzip-js"]) self.assertEqual(response["siteApps"], []) self.assertEqual( @@ -3809,20 +3730,8 @@ class TestDatabaseCheckForDecide(BaseTest, QueryMatchingTest): response = self._post_decide(api_version=3, origin="https://random.example.com").json() response = self._post_decide(api_version=3, origin="https://random.example.com").json() - self.assertEqual( - response["sessionRecording"], - { - "endpoint": "/s/", - "recorderVersion": "v2", - "consoleLogRecordingEnabled": True, - "sampleRate": "0.40", - "linkedFlag": None, - "minimumDurationMilliseconds": None, - "networkPayloadCapture": None, - "urlTriggers": [], - "urlBlocklist": [], - }, - ) + assert response["sessionRecording"] == make_session_recording_config({"sampleRate": "0.40"}) + self.assertEqual(response["supportedCompression"], ["gzip", "gzip-js"]) self.assertEqual(response["siteApps"], []) self.assertEqual( diff --git a/posthog/migrations/0516_team_session_recording_event_trigger_config.py b/posthog/migrations/0516_team_session_recording_event_trigger_config.py new file mode 100644 index 00000000000..ced2da09daf --- /dev/null +++ b/posthog/migrations/0516_team_session_recording_event_trigger_config.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.15 on 2024-11-13 14:05 + +import django.contrib.postgres.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [("posthog", "0515_grouptypemapping_project_non_null")] + + operations = [ + migrations.AddField( + model_name="team", + name="session_recording_event_trigger_config", + field=django.contrib.postgres.fields.ArrayField( + base_field=models.TextField(blank=True, null=True), blank=True, default=list, null=True, size=None + ), + ), + ] diff --git a/posthog/migrations/max_migration.txt b/posthog/migrations/max_migration.txt index d818bc23235..74175976ee6 100644 --- a/posthog/migrations/max_migration.txt +++ b/posthog/migrations/max_migration.txt @@ -1 +1 @@ -0515_grouptypemapping_project_non_null +0516_team_session_recording_event_trigger_config diff --git a/posthog/models/filters/test/__snapshots__/test_filter.ambr b/posthog/models/filters/test/__snapshots__/test_filter.ambr index 4e9267da2d3..38d231d6b63 100644 --- a/posthog/models/filters/test/__snapshots__/test_filter.ambr +++ b/posthog/models/filters/test/__snapshots__/test_filter.ambr @@ -28,6 +28,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -97,6 +98,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -166,6 +168,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -235,6 +238,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -304,6 +308,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/models/team/team.py b/posthog/models/team/team.py index 89415c7da97..b87ed07c84e 100644 --- a/posthog/models/team/team.py +++ b/posthog/models/team/team.py @@ -249,6 +249,9 @@ class Team(UUIDClassicModel): session_recording_url_blocklist_config = ArrayField( models.JSONField(null=True, blank=True), default=list, blank=True, null=True ) + session_recording_event_trigger_config = ArrayField( + models.TextField(null=True, blank=True), default=list, blank=True, null=True + ) session_replay_config = models.JSONField(null=True, blank=True) survey_config = models.JSONField(null=True, blank=True) capture_console_log_opt_in = models.BooleanField(null=True, blank=True, default=True) diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr index 190216feb13..220b74452fa 100644 --- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr +++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr @@ -28,6 +28,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -97,6 +98,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -166,6 +168,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -235,6 +238,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -304,6 +308,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -481,6 +486,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -575,6 +581,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -950,6 +957,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1051,6 +1059,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1120,6 +1129,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1189,6 +1199,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1258,6 +1269,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1327,6 +1339,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1396,6 +1409,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1497,6 +1511,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1698,6 +1713,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -1837,6 +1853,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2304,6 +2321,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2443,6 +2461,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2597,6 +2616,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -2954,6 +2974,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3112,6 +3133,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3575,6 +3597,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -3746,6 +3769,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4026,6 +4050,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4254,6 +4279,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -4393,6 +4419,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5267,6 +5294,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5406,6 +5434,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -5851,6 +5880,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6011,6 +6041,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6518,6 +6549,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -6676,6 +6708,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7125,6 +7158,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -7264,6 +7298,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr index 4e2046f622d..64eda354dd0 100644 --- a/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr +++ b/posthog/tasks/test/__snapshots__/test_process_scheduled_changes.ambr @@ -99,6 +99,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -366,6 +367,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", diff --git a/posthog/test/__snapshots__/test_feature_flag.ambr b/posthog/test/__snapshots__/test_feature_flag.ambr index fe95ff9b2ce..fefcbbffd5d 100644 --- a/posthog/test/__snapshots__/test_feature_flag.ambr +++ b/posthog/test/__snapshots__/test_feature_flag.ambr @@ -152,6 +152,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -327,6 +328,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in", @@ -670,6 +672,7 @@ "posthog_team"."session_recording_network_payload_capture_config", "posthog_team"."session_recording_url_trigger_config", "posthog_team"."session_recording_url_blocklist_config", + "posthog_team"."session_recording_event_trigger_config", "posthog_team"."session_replay_config", "posthog_team"."survey_config", "posthog_team"."capture_console_log_opt_in",