diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsx index 758ddcf6e38e0..b750e3558b2fc 100644 --- a/frontend/src/lib/constants.tsx +++ b/frontend/src/lib/constants.tsx @@ -169,6 +169,7 @@ export const FEATURE_FLAGS = { WEBHOOKS_DENYLIST: 'webhooks-denylist', // owner: #team-pipeline SURVEYS_SITE_APP_DEPRECATION: 'surveys-site-app-deprecation', // owner: @neilkakkar SURVEYS_MULTIPLE_QUESTIONS: 'surveys-multiple-questions', // owner: @liyiy + CONSOLE_RECORDING_SEARCH: 'console-recording-search', // owner: #team-monitoring } as const export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS] diff --git a/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx b/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx index e277a3b4a997a..7c1eaa51ca27f 100644 --- a/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx +++ b/frontend/src/scenes/session-recordings/filters/AdvancedSessionRecordingsFilters.tsx @@ -14,10 +14,12 @@ import { } from '~/types' import { DateFilter } from 'lib/components/DateFilter/DateFilter' import { DurationFilter } from './DurationFilter' -import { LemonButtonWithDropdown, LemonCheckbox } from '@posthog/lemon-ui' +import { LemonButtonWithDropdown, LemonCheckbox, LemonInput } from '@posthog/lemon-ui' import { TestAccountFilter } from 'scenes/insights/filters/TestAccountFilter' import { teamLogic } from 'scenes/teamLogic' import { useValues } from 'kea' +import { FEATURE_FLAGS } from 'lib/constants' +import { FlaggedFeature } from 'lib/components/FlaggedFeature' export const AdvancedSessionRecordingsFilters = ({ filters, @@ -33,6 +35,7 @@ export const AdvancedSessionRecordingsFilters = ({ showPropertyFilters?: boolean }): JSX.Element => { const { currentTeam } = useValues(teamLogic) + const hasGroupFilters = (currentTeam?.test_account_filters || []) .map((x) => x.type) .includes(PropertyFilterType.Group) @@ -131,6 +134,19 @@ export const AdvancedSessionRecordingsFilters = ({ Filter by console logs + + { + setFilters({ + console_search_query: s, + }) + }} + /> + diff --git a/frontend/src/types.ts b/frontend/src/types.ts index 14d971b8624e8..13d9db5905a55 100644 --- a/frontend/src/types.ts +++ b/frontend/src/types.ts @@ -750,6 +750,7 @@ export interface RecordingFilters { properties?: AnyPropertyFilter[] session_recording_duration?: RecordingDurationFilter duration_type_filter?: DurationType + console_search_query?: string console_logs?: FilterableLogLevel[] filter_test_accounts?: boolean } diff --git a/plugin-server/src/config/config.ts b/plugin-server/src/config/config.ts index 4c3fe5fce3f0f..a2a6bb6cbbf6e 100644 --- a/plugin-server/src/config/config.ts +++ b/plugin-server/src/config/config.ts @@ -155,6 +155,8 @@ export function getDefaultConfig(): PluginsServerConfig { SESSION_RECORDING_PARALLEL_CONSUMPTION: false, POSTHOG_SESSION_RECORDING_REDIS_HOST: undefined, POSTHOG_SESSION_RECORDING_REDIS_PORT: undefined, + // by default a very restricted list of teams, so we can slowly roll out + MAX_TEAM_TO_ALLOW_SESSION_RECORDING_CONSOLE_LOGS_INGESTION: 2, } } diff --git a/plugin-server/src/config/kafka-topics.ts b/plugin-server/src/config/kafka-topics.ts index 78cfc76f65f98..0926d239447c7 100644 --- a/plugin-server/src/config/kafka-topics.ts +++ b/plugin-server/src/config/kafka-topics.ts @@ -37,3 +37,6 @@ export const KAFKA_CLICKHOUSE_SESSION_RECORDING_EVENTS = `${prefix}clickhouse_se export const KAFKA_CLICKHOUSE_SESSION_REPLAY_EVENTS = `${prefix}clickhouse_session_replay_events${suffix}` // write performance events to ClickHouse export const KAFKA_PERFORMANCE_EVENTS = `${prefix}clickhouse_performance_events${suffix}` + +// log entries for ingestion into clickhouse +export const KAFKA_LOG_ENTRIES = `${prefix}log_entries${suffix}` diff --git a/plugin-server/src/main/ingestion-queues/session-recording/services/console-logs-ingester.ts b/plugin-server/src/main/ingestion-queues/session-recording/services/console-logs-ingester.ts new file mode 100644 index 0000000000000..1d9552b3f5068 --- /dev/null +++ b/plugin-server/src/main/ingestion-queues/session-recording/services/console-logs-ingester.ts @@ -0,0 +1,162 @@ +import { captureException } from '@sentry/node' +import { HighLevelProducer as RdKafkaProducer, NumberNullUndefined } from 'node-rdkafka-acosom' +import { Counter } from 'prom-client' + +import { KAFKA_LOG_ENTRIES } from '../../../../config/kafka-topics' +import { createRdConnectionConfigFromEnvVars } from '../../../../kafka/config' +import { findOffsetsToCommit } from '../../../../kafka/consumer' +import { retryOnDependencyUnavailableError } from '../../../../kafka/error-handling' +import { createKafkaProducer, disconnectProducer, flushProducer, produce } from '../../../../kafka/producer' +import { PluginsServerConfig } from '../../../../types' +import { status } from '../../../../utils/status' +import { gatherConsoleLogEvents } from '../../../../worker/ingestion/process-event' +import { eventDroppedCounter } from '../../metrics' +import { IncomingRecordingMessage } from '../types' +import { OffsetHighWaterMarker } from './offset-high-water-marker' + +const HIGH_WATERMARK_KEY = 'session_replay_console_logs_events_ingester' + +const consoleLogEventsCounter = new Counter({ + name: 'console_log_events_ingested', + help: 'Number of console log events successfully ingested', +}) + +// TODO this is an almost exact duplicate of the replay events ingester +// am going to leave this duplication and then collapse it when/if we add a performance events ingester +export class ConsoleLogsIngester { + producer?: RdKafkaProducer + max_allowed_team: number + constructor( + private readonly serverConfig: PluginsServerConfig, + private readonly persistentHighWaterMarker: OffsetHighWaterMarker + ) { + this.max_allowed_team = serverConfig.MAX_TEAM_TO_ALLOW_SESSION_RECORDING_CONSOLE_LOGS_INGESTION + } + + public async consumeBatch(messages: IncomingRecordingMessage[]) { + const pendingProduceRequests: Promise[] = [] + + for (const message of messages) { + const results = await retryOnDependencyUnavailableError(() => this.consume(message)) + if (results) { + pendingProduceRequests.push(...results) + } + } + + // On each loop, we flush the producer to ensure that all messages + // are sent to Kafka. + try { + await flushProducer(this.producer!) + } catch (error) { + // Rather than handling errors from flush, we instead handle + // errors per produce request, which gives us a little more + // flexibility in terms of deciding if it is a terminal + // error or not. + } + + // We wait on all the produce requests to complete. After the + // flush they should all have been resolved/rejected already. If + // we get an intermittent error, such as a Kafka broker being + // unavailable, we will throw. We are relying on the Producer + // already having handled retries internally. + for (const produceRequest of pendingProduceRequests) { + try { + await produceRequest + } catch (error) { + status.error('🔁', '[console-log-events-ingester] main_loop_error', { error }) + + if (error?.isRetriable) { + // We assume the if the error is retriable, then we + // are probably in a state where e.g. Kafka is down + // temporarily and we would rather simply throw and + // have the process restarted. + throw error + } + } + } + + const topicPartitionOffsets = findOffsetsToCommit(messages.map((message) => message.metadata)) + await Promise.all( + topicPartitionOffsets.map((tpo) => this.persistentHighWaterMarker.add(tpo, HIGH_WATERMARK_KEY, tpo.offset)) + ) + } + + public async consume(event: IncomingRecordingMessage): Promise[] | void> { + const warn = (text: string, labels: Record = {}) => + status.warn('⚠️', `[console-log-events-ingester] ${text}`, { + offset: event.metadata.offset, + partition: event.metadata.partition, + ...labels, + }) + + const drop = (reason: string, labels: Record = {}) => { + eventDroppedCounter + .labels({ + event_type: 'session_recordings_console_log_events', + drop_cause: reason, + }) + .inc() + + warn(reason, { + reason, + ...labels, + }) + } + + // capture the producer so that TypeScript knows it's not null below this check + const producer = this.producer + if (!producer) { + return drop('producer_not_ready') + } + + if ( + await this.persistentHighWaterMarker.isBelowHighWaterMark( + event.metadata, + HIGH_WATERMARK_KEY, + event.metadata.offset + ) + ) { + return drop('high_water_mark') + } + + if (event.team_id > this.max_allowed_team) { + return drop('team_above_max_allowed') + } + + try { + const consoleLogEvents = gatherConsoleLogEvents(event.team_id, event.session_id, event.events) + + consoleLogEventsCounter.inc(consoleLogEvents.length) + + return consoleLogEvents.map((cle) => + produce({ + producer, + topic: KAFKA_LOG_ENTRIES, + value: Buffer.from(JSON.stringify(cle)), + key: event.session_id, + }) + ) + } catch (error) { + status.error('⚠️', '[console-log-events-ingester] processing_error', { + error: error, + }) + captureException(error, { + tags: { source: 'console-log-events-ingester', team_id: event.team_id, session_id: event.session_id }, + }) + } + } + public async start(): Promise { + const connectionConfig = createRdConnectionConfigFromEnvVars(this.serverConfig) + this.producer = await createKafkaProducer(connectionConfig) + this.producer.connect() + } + + public async stop(): Promise { + status.info('🔁', '[console-log-events-ingester] stopping') + + if (this.producer && this.producer.isConnected()) { + status.info('🔁', '[console-log-events-ingester] disconnecting kafka producer in batchConsumer stop') + await disconnectProducer(this.producer) + } + } +} diff --git a/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts b/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts index 1cdbcdbb0aa5c..49f9fbc60daa2 100644 --- a/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts +++ b/plugin-server/src/main/ingestion-queues/session-recording/session-recordings-consumer-v2.ts @@ -18,6 +18,7 @@ import { fetchTeamTokensWithRecordings } from '../../../worker/ingestion/team-ma import { ObjectStorage } from '../../services/object_storage' import { addSentryBreadcrumbsEventListeners } from '../kafka-metrics' import { eventDroppedCounter } from '../metrics' +import { ConsoleLogsIngester } from './services/console-logs-ingester' import { OffsetHighWaterMarker } from './services/offset-high-water-marker' import { PartitionLocker } from './services/partition-locker' import { RealtimeManager } from './services/realtime-manager' @@ -101,6 +102,7 @@ export class SessionRecordingIngesterV2 { persistentHighWaterMarker: OffsetHighWaterMarker realtimeManager: RealtimeManager replayEventsIngester: ReplayEventsIngester + consoleLogsIngester: ConsoleLogsIngester partitionLocker: PartitionLocker batchConsumer?: BatchConsumer partitionAssignments: Record = {} @@ -137,6 +139,7 @@ export class SessionRecordingIngesterV2 { // NOTE: This is the only place where we need to use the shared server config this.replayEventsIngester = new ReplayEventsIngester(globalServerConfig, this.persistentHighWaterMarker) + this.consoleLogsIngester = new ConsoleLogsIngester(globalServerConfig, this.persistentHighWaterMarker) this.teamsRefresher = new BackgroundRefresher(async () => { try { @@ -407,6 +410,13 @@ export class SessionRecordingIngesterV2 { await this.replayEventsIngester.consumeBatch(recordingMessages) }, }) + + await runInstrumentedFunction({ + statsKey: `recordingingester.handleEachBatch.consumeConsoleLogEvents`, + func: async () => { + await this.consoleLogsIngester.consumeBatch(recordingMessages) + }, + }) }, }) } @@ -435,6 +445,7 @@ export class SessionRecordingIngesterV2 { // Load teams into memory await this.teamsRefresher.refresh() await this.replayEventsIngester.start() + await this.consoleLogsIngester.start() if (this.config.SESSION_RECORDING_PARTITION_REVOKE_OPTIMIZATION) { this.partitionLockInterval = setInterval(async () => { @@ -520,6 +531,7 @@ export class SessionRecordingIngesterV2 { void this.scheduleWork(this.onRevokePartitions(this.assignedTopicPartitions)) void this.scheduleWork(this.realtimeManager.unsubscribe()) void this.scheduleWork(this.replayEventsIngester.stop()) + void this.scheduleWork(this.consoleLogsIngester.stop()) const promiseResults = await Promise.allSettled(this.promises) diff --git a/plugin-server/src/types.ts b/plugin-server/src/types.ts index 65c684386802b..c6616f0d31c00 100644 --- a/plugin-server/src/types.ts +++ b/plugin-server/src/types.ts @@ -222,6 +222,8 @@ export interface PluginsServerConfig { SESSION_RECORDING_REDIS_PREFIX: string SESSION_RECORDING_PARTITION_REVOKE_OPTIMIZATION: boolean SESSION_RECORDING_PARALLEL_CONSUMPTION: boolean + // team ids greater than this won't ingest console logs separately, allows controlled rollout by team + MAX_TEAM_TO_ALLOW_SESSION_RECORDING_CONSOLE_LOGS_INGESTION: number // Dedicated infra values SESSION_RECORDING_KAFKA_HOSTS: string | undefined diff --git a/plugin-server/src/worker/ingestion/process-event.ts b/plugin-server/src/worker/ingestion/process-event.ts index 155404701790e..21b4995a2a6d8 100644 --- a/plugin-server/src/worker/ingestion/process-event.ts +++ b/plugin-server/src/worker/ingestion/process-event.ts @@ -5,6 +5,7 @@ import { DateTime } from 'luxon' import { activeMilliseconds } from '../../main/ingestion-queues/session-recording/snapshot-segmenter' import { + ClickHouseTimestamp, Element, GroupTypeIndex, Hub, @@ -286,6 +287,92 @@ export interface SummarizedSessionRecordingEvent { message_count: number } +type ConsoleLogEntry = { + team_id: number + message: string + log_level: 'info' | 'warn' | 'error' + log_source: 'session_replay' + // the session_id + log_source_id: string + // The ClickHouse log_entries table collapses input based on its order by key + // team_id, log_source, log_source_id, instance_id, timestamp + // since we don't have a natural instance id, we don't send one. + // This means that if we can log two messages for one session with the same timestamp + // we might lose one of them + // in practice console log timestamps are pretty precise: 2023-10-04 07:53:29.586 + // so, this is unlikely enough that we can avoid filling the DB with UUIDs only to avoid losing + // a very, very small proportion of console logs. + instance_id: string + timestamp: ClickHouseTimestamp +} + +function safeString(payload: string[]) { + // the individual strings are sometimes wrapped in quotes... we want to strip those + return payload + .map((item) => { + let candidate = item + if (candidate.startsWith('"') || candidate.startsWith("'")) { + candidate = candidate.substring(1) + } + + if (candidate.endsWith('"') || candidate.endsWith("'")) { + candidate = candidate.substring(0, candidate.length - 1) + } + return candidate + }) + .join(' ') +} + +enum RRWebEventType { + DomContentLoaded = 0, + Load = 1, + FullSnapshot = 2, + IncrementalSnapshot = 3, + Meta = 4, + Custom = 5, + Plugin = 6, +} + +enum RRWebEventSource { + Mutation = 0, + MouseMove = 1, + MouseInteraction = 2, + Scroll = 3, + ViewportResize = 4, + Input = 5, + TouchMove = 6, + MediaInteraction = 7, + StyleSheetRule = 8, + CanvasMutation = 9, + Font = 1, + Log = 1, + Drag = 1, + StyleDeclaration = 1, + Selection = 1, +} +export const gatherConsoleLogEvents = (team_id: number, session_id: string, events: RRWebEvent[]) => { + const consoleLogEntries: ConsoleLogEntry[] = [] + + events.forEach((event) => { + if (event.type === RRWebEventType.Plugin && event.data?.plugin === 'rrweb/console@1') { + const level = event.data.payload?.level + const message = safeString(event.data.payload?.payload) + consoleLogEntries.push({ + team_id, + // TODO when is it not a single item array? + message: message, + log_level: level, + log_source: 'session_replay', + log_source_id: session_id, + instance_id: event.data.instanceId, + timestamp: castTimestampOrNow(DateTime.fromMillis(event.timestamp), TimestampFormat.ClickHouse), + }) + } + }) + + return consoleLogEntries +} + export const createSessionReplayEvent = ( uuid: string, team_id: number, @@ -316,19 +403,19 @@ export const createSessionReplayEvent = ( let consoleErrorCount = 0 let url: string | null = null events.forEach((event) => { - if (event.type === 3) { + if (event.type === RRWebEventType.IncrementalSnapshot) { mouseActivity += 1 - if (event.data?.source === 2) { + if (event.data?.source === RRWebEventSource.MouseInteraction) { clickCount += 1 } - if (event.data?.source === 5) { + if (event.data?.source === RRWebEventSource.Input) { keypressCount += 1 } } if (url === null && !!event.data?.href?.trim().length) { url = event.data.href } - if (event.type === 6 && event.data?.plugin === 'rrweb/console@1') { + if (event.type === RRWebEventType.Plugin && event.data?.plugin === 'rrweb/console@1') { const level = event.data.payload?.level if (level === 'log') { consoleLogCount += 1 diff --git a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts index e39da232a1755..055fbfa1933ae 100644 --- a/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts +++ b/plugin-server/tests/main/ingestion-queues/session-recording/session-recordings-consumer-v2.test.ts @@ -415,6 +415,7 @@ describe('ingester', () => { // whereas the commited kafka offset should be the 1st message as the 2nd message HAS not been processed await expect(getPersistentWaterMarks()).resolves.toEqual({ 'session-recordings-blob': 1, + session_replay_console_logs_events_ingester: 3, session_replay_events_ingester: 3, }) }) @@ -428,6 +429,7 @@ describe('ingester', () => { await commitAllOffsets() expect(mockCommit).not.toHaveBeenCalled() await expect(getPersistentWaterMarks()).resolves.toEqual({ + session_replay_console_logs_events_ingester: 2, session_replay_events_ingester: 2, }) await expect(getSessionWaterMarks()).resolves.toEqual({ @@ -554,11 +556,12 @@ describe('ingester', () => { it('shuts down without error', async () => { await setup() - // revoke, realtime unsub, replay stop + // revoke, realtime unsub, replay stop, console ingestion stop await expect(ingester.stop()).resolves.toMatchObject([ { status: 'fulfilled' }, { status: 'fulfilled' }, { status: 'fulfilled' }, + { status: 'fulfilled' }, ]) }) }) diff --git a/posthog/api/__init__.py b/posthog/api/__init__.py index b5ca842983f8a..aa82ea7485d1a 100644 --- a/posthog/api/__init__.py +++ b/posthog/api/__init__.py @@ -4,7 +4,6 @@ from posthog.batch_exports import http as batch_exports from posthog.settings import EE_AVAILABLE from posthog.warehouse.api import saved_query, table, view_link - from ..session_recordings.session_recording_api import SessionRecordingViewSet from . import ( activity_log, diff --git a/posthog/models/filters/mixins/session_recordings.py b/posthog/models/filters/mixins/session_recordings.py index 223491df85e7c..1d9b58c73cf83 100644 --- a/posthog/models/filters/mixins/session_recordings.py +++ b/posthog/models/filters/mixins/session_recordings.py @@ -14,6 +14,10 @@ def person_uuid(self) -> Optional[str]: class SessionRecordingsMixin(BaseParamMixin): + @cached_property + def console_search_query(self) -> str | None: + return self._data.get("console_search_query", None) + @cached_property def console_logs_filter(self) -> List[Literal["error", "warn", "log"]]: user_value = self._data.get("console_logs", None) or [] diff --git a/posthog/session_recordings/queries/session_recording_list_from_replay_summary.py b/posthog/session_recordings/queries/session_recording_list_from_replay_summary.py index fea81ced5d0eb..0ef6a674a113b 100644 --- a/posthog/session_recordings/queries/session_recording_list_from_replay_summary.py +++ b/posthog/session_recordings/queries/session_recording_list_from_replay_summary.py @@ -46,6 +46,20 @@ def _get_recording_start_time_clause(recording_filters: SessionRecordingsFilter) return start_time_clause, start_time_params +def _get_filter_by_log_text_session_ids_clause( + team: Team, recording_filters: SessionRecordingsFilter, column_name="session_id" +) -> Tuple[str, Dict[str, Any]]: + if not recording_filters.console_search_query: + return "", {} + + log_query = LogQuery(team=team, filter=recording_filters).get_query() + matching_session_ids = sync_execute(log_query[0], log_query[1]) + + # we return this _even_ if there are no matching ids since if there are no matching ids + # then no sessions can match... + return f'AND "{column_name}" in %(session_ids)s', {"session_ids": [x[0] for x in matching_session_ids]} + + def _get_filter_by_provided_session_ids_clause( recording_filters: SessionRecordingsFilter, column_name="session_id" ) -> Tuple[str, Dict[str, Any]]: @@ -71,6 +85,80 @@ def ttl_days(team: Team) -> int: return ttl_days +class LogQuery: + _filter: SessionRecordingsFilter + _team_id: int + _team: Team + + def __init__( + self, + team: Team, + filter: SessionRecordingsFilter, + ): + self._filter = filter + self._team = team + self._team_id = team.pk + + _rawQuery = """ + SELECT distinct log_source_id as session_id + FROM log_entries + PREWHERE team_id = %(team_id)s + AND timestamp >= %(clamped_to_storage_ttl)s + AND timestamp <= now() + {events_timestamp_clause} + WHERE 1=1 + {console_log_clause} + AND position(%(console_search_query)s in message) > 0 + """ + + @property + def ttl_days(self): + return ttl_days(self._team) + + # We want to select events beyond the range of the recording to handle the case where + # a recording spans the time boundaries + # TODO This is just copied from below + @cached_property + def _get_events_timestamp_clause(self) -> Tuple[str, Dict[str, Any]]: + timestamp_clause = "" + timestamp_params = {} + if self._filter.date_from: + timestamp_clause += "\nAND timestamp >= %(event_start_time)s" + timestamp_params["event_start_time"] = self._filter.date_from - timedelta(hours=12) + if self._filter.date_to: + timestamp_clause += "\nAND timestamp <= %(event_end_time)s" + timestamp_params["event_end_time"] = self._filter.date_to + timedelta(hours=12) + return timestamp_clause, timestamp_params + + @staticmethod + def _get_console_log_clause( + console_logs_filter: List[Literal["error", "warn", "log"]] + ) -> Tuple[str, Dict[str, Any]]: + return ( + (f"AND level in %(console_logs_levels)s", {"console_logs_levels": console_logs_filter}) + if console_logs_filter + else ("", {}) + ) + + def get_query(self): + if not self._filter.console_search_query: + return "", {} + + events_timestamp_clause, events_timestamp_params = self._get_events_timestamp_clause + console_log_clause, console_log_params = self._get_console_log_clause(self._filter.console_logs_filter) + + return self._rawQuery.format( + events_timestamp_clause=events_timestamp_clause, + console_log_clause=console_log_clause, + ), { + "team_id": self._team_id, + "clamped_to_storage_ttl": (datetime.now() - timedelta(days=self.ttl_days)), + "console_search_query": self._filter.console_search_query, + **events_timestamp_params, + **console_log_params, + } + + class PersonsQuery(EventQuery): _filter: SessionRecordingsFilter @@ -436,6 +524,7 @@ def ttl_days(self): {persons_sub_query} {events_sub_query} {provided_session_ids_clause} + {log_matching_session_ids_clause} GROUP BY session_id HAVING 1=1 {duration_clause} {console_log_clause} ORDER BY start_time DESC @@ -501,6 +590,11 @@ def get_query(self) -> Tuple[str, Dict[str, Any]]: provided_session_ids_clause, provided_session_ids_params = _get_filter_by_provided_session_ids_clause( recording_filters=self._filter ) + + log_matching_session_ids_clause, log_matching_session_ids_params = _get_filter_by_log_text_session_ids_clause( + team=self._team, recording_filters=self._filter + ) + duration_clause, duration_params = self.duration_clause(self._filter.duration_type_filter) console_log_clause = self._get_console_log_clause(self._filter.console_logs_filter) @@ -524,6 +618,7 @@ def get_query(self) -> Tuple[str, Dict[str, Any]]: console_log_clause=console_log_clause, persons_sub_query=persons_select, events_sub_query=events_select, + log_matching_session_ids_clause=log_matching_session_ids_clause, ), { **base_params, @@ -532,6 +627,7 @@ def get_query(self) -> Tuple[str, Dict[str, Any]]: **duration_params, **provided_session_ids_params, **persons_select_params, + **log_matching_session_ids_params, }, ) diff --git a/posthog/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_session_replay.ambr b/posthog/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_session_replay.ambr index e55e77459d22a..9505ae1f31cff 100644 --- a/posthog/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_session_replay.ambr +++ b/posthog/session_recordings/queries/test/__snapshots__/test_session_recording_list_from_session_replay.ambr @@ -2645,6 +2645,192 @@ OFFSET 0 ' --- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text + ' + + SELECT distinct log_source_id as session_id + FROM log_entries PREWHERE team_id = 2 + AND timestamp >= '2020-12-31 20:00:00' + AND timestamp <= now() + AND timestamp >= '2021-01-13 12:00:00' + AND timestamp <= '2021-01-22 08:00:00' + WHERE 1=1 + AND level in ['warn', 'error'] + AND position('message 4' in message) > 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.1 + ' + + SELECT s.session_id, + any(s.team_id), + any(s.distinct_id), + min(s.min_first_timestamp) as start_time, + max(s.max_last_timestamp) as end_time, + dateDiff('SECOND', start_time, end_time) as duration, + argMinMerge(s.first_url) as first_url, + sum(s.click_count), + sum(s.keypress_count), + sum(s.mouse_activity_count), + sum(s.active_milliseconds)/1000 as active_seconds, + duration-active_seconds as inactive_seconds, + sum(s.console_log_count) as console_log_count, + sum(s.console_warn_count) as console_warn_count, + sum(s.console_error_count) as console_error_count + FROM session_replay_events s + WHERE s.team_id = 2 + AND s.min_first_timestamp >= '2020-12-31 20:00:00' + AND s.min_first_timestamp >= '2021-01-14 00:00:00' + AND s.max_last_timestamp <= '2021-01-21 20:00:00' + AND "session_id" in ['with-two-session-0b02c31f-341b-49cb-93d2-e8a2e4bf8330', 'with-errors-session-ea3f51a1-816a-4de4-9770-93f09d087477', 'with-warns-session-365c77cc-7d10-4925-816c-6f4930d75728'] + GROUP BY session_id + HAVING 1=1 + AND (console_warn_count > 0 + OR console_error_count > 0) + ORDER BY start_time DESC + LIMIT 51 + OFFSET 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.2 + ' + + SELECT distinct log_source_id as session_id + FROM log_entries PREWHERE team_id = 2 + AND timestamp >= '2020-12-31 20:00:00' + AND timestamp <= now() + AND timestamp >= '2021-01-13 12:00:00' + AND timestamp <= '2021-01-22 08:00:00' + WHERE 1=1 + AND level in ['warn', 'error'] + AND position('message 5' in message) > 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.3 + ' + + SELECT s.session_id, + any(s.team_id), + any(s.distinct_id), + min(s.min_first_timestamp) as start_time, + max(s.max_last_timestamp) as end_time, + dateDiff('SECOND', start_time, end_time) as duration, + argMinMerge(s.first_url) as first_url, + sum(s.click_count), + sum(s.keypress_count), + sum(s.mouse_activity_count), + sum(s.active_milliseconds)/1000 as active_seconds, + duration-active_seconds as inactive_seconds, + sum(s.console_log_count) as console_log_count, + sum(s.console_warn_count) as console_warn_count, + sum(s.console_error_count) as console_error_count + FROM session_replay_events s + WHERE s.team_id = 2 + AND s.min_first_timestamp >= '2020-12-31 20:00:00' + AND s.min_first_timestamp >= '2021-01-14 00:00:00' + AND s.max_last_timestamp <= '2021-01-21 20:00:00' + AND "session_id" in ['with-warns-session-365c77cc-7d10-4925-816c-6f4930d75728'] + GROUP BY session_id + HAVING 1=1 + AND (console_warn_count > 0 + OR console_error_count > 0) + ORDER BY start_time DESC + LIMIT 51 + OFFSET 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.4 + ' + + SELECT distinct log_source_id as session_id + FROM log_entries PREWHERE team_id = 2 + AND timestamp >= '2020-12-31 20:00:00' + AND timestamp <= now() + AND timestamp >= '2021-01-13 12:00:00' + AND timestamp <= '2021-01-22 08:00:00' + WHERE 1=1 + AND level in ['log'] + AND position('message 5' in message) > 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.5 + ' + + SELECT s.session_id, + any(s.team_id), + any(s.distinct_id), + min(s.min_first_timestamp) as start_time, + max(s.max_last_timestamp) as end_time, + dateDiff('SECOND', start_time, end_time) as duration, + argMinMerge(s.first_url) as first_url, + sum(s.click_count), + sum(s.keypress_count), + sum(s.mouse_activity_count), + sum(s.active_milliseconds)/1000 as active_seconds, + duration-active_seconds as inactive_seconds, + sum(s.console_log_count) as console_log_count, + sum(s.console_warn_count) as console_warn_count, + sum(s.console_error_count) as console_error_count + FROM session_replay_events s + WHERE s.team_id = 2 + AND s.min_first_timestamp >= '2020-12-31 20:00:00' + AND s.min_first_timestamp >= '2021-01-14 00:00:00' + AND s.max_last_timestamp <= '2021-01-21 20:00:00' + AND "session_id" in [] + GROUP BY session_id + HAVING 1=1 + AND (console_log_count > 0) + ORDER BY start_time DESC + LIMIT 51 + OFFSET 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.6 + ' + + SELECT distinct log_source_id as session_id + FROM log_entries PREWHERE team_id = 2 + AND timestamp >= '2020-12-31 20:00:00' + AND timestamp <= now() + AND timestamp >= '2021-01-13 12:00:00' + AND timestamp <= '2021-01-22 08:00:00' + WHERE 1=1 + AND level in ['log'] + AND position('message 5' in message) > 0 + ' +--- +# name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_by_console_text.7 + ' + + SELECT s.session_id, + any(s.team_id), + any(s.distinct_id), + min(s.min_first_timestamp) as start_time, + max(s.max_last_timestamp) as end_time, + dateDiff('SECOND', start_time, end_time) as duration, + argMinMerge(s.first_url) as first_url, + sum(s.click_count), + sum(s.keypress_count), + sum(s.mouse_activity_count), + sum(s.active_milliseconds)/1000 as active_seconds, + duration-active_seconds as inactive_seconds, + sum(s.console_log_count) as console_log_count, + sum(s.console_warn_count) as console_warn_count, + sum(s.console_error_count) as console_error_count + FROM session_replay_events s + WHERE s.team_id = 2 + AND s.min_first_timestamp >= '2020-12-31 20:00:00' + AND s.min_first_timestamp >= '2021-01-14 00:00:00' + AND s.max_last_timestamp <= '2021-01-21 20:00:00' + AND "session_id" in [] + GROUP BY session_id + HAVING 1=1 + AND (console_log_count > 0) + ORDER BY start_time DESC + LIMIT 51 + OFFSET 0 + ' +--- # name: TestClickhouseSessionRecordingsListFromSessionReplay.test_filter_for_recordings_with_console_errors ' diff --git a/posthog/session_recordings/queries/test/session_replay_sql.py b/posthog/session_recordings/queries/test/session_replay_sql.py index 9e5d445375358..fcc3eee03a44e 100644 --- a/posthog/session_recordings/queries/test/session_replay_sql.py +++ b/posthog/session_recordings/queries/test/session_replay_sql.py @@ -1,11 +1,13 @@ from datetime import datetime -from typing import Optional +from typing import Optional, List, Dict +from uuid import uuid4 from dateutil.parser import parse from dateutil.relativedelta import relativedelta +from posthog.clickhouse.log_entries import INSERT_LOG_ENTRY_SQL from posthog.kafka_client.client import ClickhouseProducer -from posthog.kafka_client.topics import KAFKA_CLICKHOUSE_SESSION_REPLAY_EVENTS +from posthog.kafka_client.topics import KAFKA_CLICKHOUSE_SESSION_REPLAY_EVENTS, KAFKA_LOG_ENTRIES from posthog.models.event.util import format_clickhouse_timestamp from posthog.utils import cast_timestamp_or_now @@ -106,16 +108,20 @@ def produce_replay_summary( console_log_count: Optional[int] = None, console_warn_count: Optional[int] = None, console_error_count: Optional[int] = None, + log_messages: Dict[str, List[str]] | None = None, ): + if log_messages is None: + log_messages = {} first_timestamp = _sensible_first_timestamp(first_timestamp, last_timestamp) last_timestamp = _sensible_last_timestamp(first_timestamp, last_timestamp) + timestamp = format_clickhouse_timestamp(cast_timestamp_or_now(first_timestamp)) data = { "session_id": session_id or "1", "team_id": team_id, "distinct_id": distinct_id or "user", - "first_timestamp": format_clickhouse_timestamp(cast_timestamp_or_now(first_timestamp)), + "first_timestamp": timestamp, "last_timestamp": format_clickhouse_timestamp(cast_timestamp_or_now(last_timestamp)), "first_url": first_url, "click_count": click_count or 0, @@ -129,3 +135,22 @@ def produce_replay_summary( p = ClickhouseProducer() # because this is in a test it will write directly using SQL not really with Kafka p.produce(topic=KAFKA_CLICKHOUSE_SESSION_REPLAY_EVENTS, sql=INSERT_SINGLE_SESSION_REPLAY, data=data) + + for level, messages in log_messages.items(): + for message in messages: + p.produce( + topic=KAFKA_LOG_ENTRIES, + sql=INSERT_LOG_ENTRY_SQL, + data={ + "team_id": team_id, + "message": message, + "level": level, + "log_source": "session_replay", + "log_source_id": session_id, + # TRICKY: this is a hack to make sure the log entry is unique + # otherwise ClickHouse will assume that multiple entries + # with the same timestamp can be ignored + "instance_id": str(uuid4()), + "timestamp": timestamp, + }, + ) diff --git a/posthog/session_recordings/queries/test/test_session_recording_list.py b/posthog/session_recordings/queries/test/test_session_recording_list.py deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/posthog/session_recordings/queries/test/test_session_recording_list_from_session_replay.py b/posthog/session_recordings/queries/test/test_session_recording_list_from_session_replay.py index 6a529313a3851..2b9c182576f89 100644 --- a/posthog/session_recordings/queries/test/test_session_recording_list_from_session_replay.py +++ b/posthog/session_recordings/queries/test/test_session_recording_list_from_session_replay.py @@ -6,6 +6,7 @@ from freezegun.api import freeze_time from posthog.clickhouse.client import sync_execute +from posthog.clickhouse.log_entries import TRUNCATE_LOG_ENTRIES_TABLE_SQL from posthog.cloud_utils import TEST_clear_cloud_cache from posthog.constants import AvailableFeature from posthog.models import Person, Cohort @@ -38,6 +39,7 @@ class TestClickhouseSessionRecordingsListFromSessionReplay(ClickhouseTestMixin, @classmethod def teardown_class(cls): sync_execute(TRUNCATE_SESSION_REPLAY_EVENTS_TABLE_SQL()) + sync_execute(TRUNCATE_LOG_ENTRIES_TABLE_SQL) def create_action(self, name, team_id=None, properties=None): if team_id is None: @@ -1971,6 +1973,99 @@ def test_filter_for_recordings_with_mixed_console_counts(self): ] ) + @snapshot_clickhouse_queries + @freeze_time("2021-01-21T20:00:00.000Z") + def test_filter_for_recordings_by_console_text(self): + Person.objects.create(team=self.team, distinct_ids=["user"], properties={"email": "bla"}) + + with_logs_session_id = f"with-logs-session-{str(uuid4())}" + with_warns_session_id = f"with-warns-session-{str(uuid4())}" + with_errors_session_id = f"with-errors-session-{str(uuid4())}" + with_two_session_id = f"with-two-session-{str(uuid4())}" + + produce_replay_summary( + distinct_id="user", + session_id=with_logs_session_id, + first_timestamp=self.base_time, + team_id=self.team.id, + console_log_count=4, + log_messages={"log": ["log message 1", "log message 2", "log message 3", "log message 4"]}, + ) + produce_replay_summary( + distinct_id="user", + session_id=with_warns_session_id, + first_timestamp=self.base_time, + team_id=self.team.id, + console_warn_count=5, + log_messages={ + "warn": ["warn message 1", "warn message 2", "warn message 3", "warn message 4", "warn message 5"] + }, + ) + produce_replay_summary( + distinct_id="user", + session_id=with_errors_session_id, + first_timestamp=self.base_time, + team_id=self.team.id, + console_error_count=4, + log_messages={"error": ["error message 1", "error message 2", "error message 3", "error message 4"]}, + ) + produce_replay_summary( + distinct_id="user", + session_id=with_two_session_id, + first_timestamp=self.base_time, + team_id=self.team.id, + console_error_count=4, + console_log_count=3, + log_messages={ + "error": ["error message 1", "error message 2", "error message 3", "error message 4"], + "log": ["log message 1", "log message 2", "log message 3"], + }, + ) + + filter = SessionRecordingsFilter( + team=self.team, + # there are 5 warn and 4 error logs, message 4 matches in both + data={"console_logs": ["warn", "error"], "console_search_query": "message 4"}, + ) + + session_recording_list_instance = SessionRecordingListFromReplaySummary(filter=filter, team=self.team) + (session_recordings, _) = session_recording_list_instance.run() + + assert sorted([sr["session_id"] for sr in session_recordings]) == sorted( + [ + with_errors_session_id, + with_two_session_id, + with_warns_session_id, + ] + ) + + filter = SessionRecordingsFilter( + team=self.team, + # there are 5 warn and 4 error logs, message 5 matches only matches in warn + data={"console_logs": ["warn", "error"], "console_search_query": "message 5"}, + ) + + session_recording_list_instance = SessionRecordingListFromReplaySummary(filter=filter, team=self.team) + (session_recordings, _) = session_recording_list_instance.run() + + assert sorted([sr["session_id"] for sr in session_recordings]) == sorted( + [ + with_warns_session_id, + ] + ) + + filter = SessionRecordingsFilter( + team=self.team, + # message 5 does not match log level "log + data={"console_logs": ["log"], "console_search_query": "message 5"}, + ) + session_recording_list_instance = SessionRecordingListFromReplaySummary(filter=filter, team=self.team) + (session_recordings, _) = session_recording_list_instance.run() + + session_recording_list_instance = SessionRecordingListFromReplaySummary(filter=filter, team=self.team) + (session_recordings, _) = session_recording_list_instance.run() + assert sorted([sr["session_id"] for sr in session_recordings]) == sorted([]) + @also_test_with_materialized_columns( event_properties=["is_internal_user"], person_properties=["email"], verify_no_jsonextract=False ) diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr index f7fe6063f3f64..5b68085b545af 100644 --- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr +++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr @@ -84,182 +84,6 @@ ' --- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.100 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105 - ' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."session_recording_opt_in", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."surveys_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical" - FROM "posthog_team" - WHERE "posthog_team"."id" = 2 - LIMIT 21 - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106 - ' - 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"."is_active", - "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"."email_opt_in", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."events_column_config" - FROM "posthog_user" - WHERE "posthog_user"."id" = 2 - LIMIT 21 /**/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -304,7 +128,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.101 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -333,7 +157,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.102 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -344,18 +168,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -366,7 +179,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -377,7 +190,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -388,7 +201,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -399,7 +212,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -410,7 +223,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -421,7 +234,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.109 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -432,18 +245,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.11 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.110 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -454,42 +267,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.111 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -500,58 +278,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.112 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -603,7 +330,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.113 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -632,7 +359,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.114 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -677,7 +404,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.115 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -706,7 +433,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.116 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -717,7 +444,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.117 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -728,7 +455,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.118 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -739,29 +466,29 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.119 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.12 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.120 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -772,7 +499,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.121 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -783,7 +510,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.122 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -794,7 +521,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.123 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -805,7 +532,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.124 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -816,7 +543,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.125 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -827,103 +554,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.126 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -975,7 +606,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.127 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1004,7 +635,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.128 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1049,7 +680,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.129 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1078,7 +709,18 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.13 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.130 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1089,7 +731,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.131 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1100,7 +742,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.132 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1111,7 +753,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.133 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1122,7 +764,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.134 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1133,59 +775,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.15 - ' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."session_recording_opt_in", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."surveys_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical" - FROM "posthog_team" - WHERE "posthog_team"."id" = 2 - LIMIT 21 - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.135 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1196,7 +786,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.136 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1207,7 +797,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1218,7 +808,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1229,7 +819,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1240,97 +830,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7', - '8') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.14 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1382,36 +882,59 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.140 ' - 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"."is_active", - "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"."email_opt_in", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."events_column_config" - FROM "posthog_user" - WHERE "posthog_user"."id" = 2 - LIMIT 21 /**/ + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."session_recording_opt_in", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."surveys_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical" + FROM "posthog_team" + WHERE "posthog_team"."id" = 2 + LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1440,7 +963,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.161 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1485,7 +1008,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1514,7 +1037,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1525,7 +1048,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1536,7 +1059,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.165 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1547,7 +1070,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1558,7 +1081,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.148 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1569,7 +1092,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.149 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1580,7 +1103,36 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.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"."is_active", + "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"."email_opt_in", + "posthog_user"."partial_notification_settings", + "posthog_user"."anonymize_data", + "posthog_user"."toolbar_mode", + "posthog_user"."events_column_config" + FROM "posthog_user" + WHERE "posthog_user"."id" = 2 + LIMIT 21 /**/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.150 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1591,52 +1143,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17 - ' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."session_recording_opt_in", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."surveys_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days" - FROM "posthog_team" - WHERE "posthog_team"."id" = 2 - LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1647,7 +1154,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.171 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1658,7 +1165,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1669,180 +1176,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.173 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8', - 'user9') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177 - ' - SELECT "posthog_team"."id", - "posthog_team"."uuid", - "posthog_team"."organization_id", - "posthog_team"."api_token", - "posthog_team"."app_urls", - "posthog_team"."name", - "posthog_team"."slack_incoming_webhook", - "posthog_team"."created_at", - "posthog_team"."updated_at", - "posthog_team"."anonymize_ips", - "posthog_team"."completed_snippet_onboarding", - "posthog_team"."has_completed_onboarding_for", - "posthog_team"."ingested_event", - "posthog_team"."autocapture_opt_out", - "posthog_team"."autocapture_exceptions_opt_in", - "posthog_team"."autocapture_exceptions_errors_to_ignore", - "posthog_team"."session_recording_opt_in", - "posthog_team"."capture_console_log_opt_in", - "posthog_team"."capture_performance_opt_in", - "posthog_team"."surveys_opt_in", - "posthog_team"."session_recording_version", - "posthog_team"."signup_token", - "posthog_team"."is_demo", - "posthog_team"."access_control", - "posthog_team"."week_start_day", - "posthog_team"."inject_web_apps", - "posthog_team"."test_account_filters", - "posthog_team"."test_account_filters_default_checked", - "posthog_team"."path_cleaning_filters", - "posthog_team"."timezone", - "posthog_team"."data_attributes", - "posthog_team"."person_display_name_properties", - "posthog_team"."live_events_columns", - "posthog_team"."recording_domains", - "posthog_team"."primary_dashboard_id", - "posthog_team"."extra_settings", - "posthog_team"."correlation_config", - "posthog_team"."session_recording_retention_period_days", - "posthog_team"."plugins_opt_in", - "posthog_team"."opt_out_capture", - "posthog_team"."event_names", - "posthog_team"."event_names_with_usage", - "posthog_team"."event_properties", - "posthog_team"."event_properties_with_usage", - "posthog_team"."event_properties_numerical" - FROM "posthog_team" - WHERE "posthog_team"."id" = 2 - LIMIT 21 - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178 - ' - 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"."is_active", - "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"."email_opt_in", - "posthog_user"."partial_notification_settings", - "posthog_user"."anonymize_data", - "posthog_user"."toolbar_mode", - "posthog_user"."events_column_config" - FROM "posthog_user" - WHERE "posthog_user"."id" = 2 - LIMIT 21 /**/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1887,7 +1221,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1916,7 +1250,29 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.180 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1939,35 +1295,13 @@ "posthog_organization"."usage", "posthog_organization"."setup_section_2_completed", "posthog_organization"."personalization", - "posthog_organization"."domain_whitelist" - FROM "posthog_organizationmembership" - INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") - WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.181 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + "posthog_organization"."domain_whitelist" + FROM "posthog_organizationmembership" + INNER JOIN "posthog_organization" ON ("posthog_organizationmembership"."organization_id" = "posthog_organization"."id") + WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1978,7 +1312,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.184 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1989,7 +1323,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.185 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2000,7 +1334,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.186 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2011,7 +1345,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.187 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2022,7 +1356,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.188 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2033,7 +1367,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.189 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2044,123 +1378,155 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.19 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.190 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28 + ' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."session_recording_opt_in", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."surveys_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical" + FROM "posthog_team" + WHERE "posthog_team"."id" = 2 + LIMIT 21 + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29 + ' + 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"."is_active", + "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"."email_opt_in", + "posthog_user"."partial_notification_settings", + "posthog_user"."anonymize_data", + "posthog_user"."toolbar_mode", + "posthog_user"."events_column_config" + FROM "posthog_user" + WHERE "posthog_user"."id" = 2 + LIMIT 21 /**/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:RATE_LIMIT_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.191 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '10', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.192 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.193 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user10', - 'user2', - 'user3', - 'user4', - 'user5', - 'user6', - 'user7', - 'user8', - 'user9') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.194 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30 + ' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."session_recording_opt_in", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."surveys_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days" + FROM "posthog_team" + WHERE "posthog_team"."id" = 2 + LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2189,7 +1555,18 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2200,7 +1577,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2211,7 +1588,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2222,7 +1599,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2233,7 +1610,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2244,7 +1621,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2255,7 +1632,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2266,18 +1643,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.4 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2288,94 +1665,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.3 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RATE_LIMIT_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.30 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.32 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.33 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2427,7 +1728,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.34 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2456,7 +1757,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2501,7 +1802,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2530,7 +1831,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2541,7 +1842,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2552,7 +1853,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2563,18 +1864,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.4 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2585,7 +1886,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2596,7 +1897,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2607,7 +1908,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2618,7 +1919,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2629,7 +1930,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2640,7 +1941,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2651,96 +1952,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.5 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.50 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2792,7 +2004,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -2821,7 +2033,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2866,7 +2078,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2895,7 +2107,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2906,51 +2118,51 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.56 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.57 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.58 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2961,7 +2173,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2972,7 +2184,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2983,7 +2195,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2994,7 +2206,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3005,7 +2217,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3016,87 +2228,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7 ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3148,18 +2291,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.7 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.70 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3188,7 +2320,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3233,7 +2365,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3262,7 +2394,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3273,7 +2405,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3284,7 +2416,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3295,7 +2427,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3306,7 +2438,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3317,7 +2449,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3328,29 +2460,29 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.8 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_V2_ENABLED' + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' ORDER BY "posthog_instancesetting"."id" ASC LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3361,7 +2493,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3372,7 +2504,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3383,89 +2515,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 - ' - SELECT "posthog_sessionrecording"."id", - "posthog_sessionrecording"."session_id", - "posthog_sessionrecording"."team_id", - "posthog_sessionrecording"."created_at", - "posthog_sessionrecording"."deleted", - "posthog_sessionrecording"."object_storage_path", - "posthog_sessionrecording"."distinct_id", - "posthog_sessionrecording"."duration", - "posthog_sessionrecording"."active_seconds", - "posthog_sessionrecording"."inactive_seconds", - "posthog_sessionrecording"."start_time", - "posthog_sessionrecording"."end_time", - "posthog_sessionrecording"."click_count", - "posthog_sessionrecording"."keypress_count", - "posthog_sessionrecording"."mouse_activity_count", - "posthog_sessionrecording"."console_log_count", - "posthog_sessionrecording"."console_warn_count", - "posthog_sessionrecording"."console_error_count", - "posthog_sessionrecording"."start_url", - "posthog_sessionrecording"."storage_version", - COUNT("posthog_sessionrecordingplaylistitem"."id") AS "pinned_count" - FROM "posthog_sessionrecording" - LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") - WHERE ("posthog_sessionrecording"."session_id" IN ('1', - '2', - '3', - '4') - AND "posthog_sessionrecording"."team_id" = 2) - GROUP BY "posthog_sessionrecording"."id" /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84 - ' - SELECT "posthog_sessionrecordingviewed"."session_id" - FROM "posthog_sessionrecordingviewed" - WHERE ("posthog_sessionrecordingviewed"."team_id" = 2 - AND "posthog_sessionrecordingviewed"."user_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version", - "posthog_person"."id", - "posthog_person"."created_at", - "posthog_person"."properties_last_updated_at", - "posthog_person"."properties_last_operation", - "posthog_person"."team_id", - "posthog_person"."properties", - "posthog_person"."is_user_id", - "posthog_person"."is_identified", - "posthog_person"."uuid", - "posthog_person"."version" - FROM "posthog_persondistinctid" - INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") - WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2', - 'user3', - 'user4') - AND "posthog_persondistinctid"."team_id" = 2) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86 - ' - SELECT "posthog_persondistinctid"."id", - "posthog_persondistinctid"."team_id", - "posthog_persondistinctid"."person_id", - "posthog_persondistinctid"."distinct_id", - "posthog_persondistinctid"."version" - FROM "posthog_persondistinctid" - WHERE "posthog_persondistinctid"."person_id" IN (1, - 2, - 3, - 4, - 5 /* ... */) /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3517,7 +2567,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3546,7 +2596,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3591,18 +2641,7 @@ LIMIT 21 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' - ORDER BY "posthog_instancesetting"."id" ASC - LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ - ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.90 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3631,7 +2670,7 @@ WHERE "posthog_organizationmembership"."user_id" = 2 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3642,7 +2681,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3653,7 +2692,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.9 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:PERSON_ON_EVENTS_ENABLED' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.90 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3664,7 +2714,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3675,7 +2725,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3686,7 +2736,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3697,7 +2747,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3708,7 +2758,7 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3719,7 +2769,18 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.96 + ' + SELECT "posthog_instancesetting"."id", + "posthog_instancesetting"."key", + "posthog_instancesetting"."raw_value" + FROM "posthog_instancesetting" + WHERE "posthog_instancesetting"."key" = 'constance:posthog:AGGREGATE_BY_DISTINCT_IDS_TEAMS' + ORDER BY "posthog_instancesetting"."id" ASC + LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3730,3 +2791,84 @@ LIMIT 1 /*controller='project_session_recordings-list',route='api/projects/%28%3FP%3Cparent_lookup_team_id%3E%5B%5E/.%5D%2B%29/session_recordings/%3F%24'*/ ' --- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98 + ' + SELECT "posthog_team"."id", + "posthog_team"."uuid", + "posthog_team"."organization_id", + "posthog_team"."api_token", + "posthog_team"."app_urls", + "posthog_team"."name", + "posthog_team"."slack_incoming_webhook", + "posthog_team"."created_at", + "posthog_team"."updated_at", + "posthog_team"."anonymize_ips", + "posthog_team"."completed_snippet_onboarding", + "posthog_team"."has_completed_onboarding_for", + "posthog_team"."ingested_event", + "posthog_team"."autocapture_opt_out", + "posthog_team"."autocapture_exceptions_opt_in", + "posthog_team"."autocapture_exceptions_errors_to_ignore", + "posthog_team"."session_recording_opt_in", + "posthog_team"."capture_console_log_opt_in", + "posthog_team"."capture_performance_opt_in", + "posthog_team"."surveys_opt_in", + "posthog_team"."session_recording_version", + "posthog_team"."signup_token", + "posthog_team"."is_demo", + "posthog_team"."access_control", + "posthog_team"."week_start_day", + "posthog_team"."inject_web_apps", + "posthog_team"."test_account_filters", + "posthog_team"."test_account_filters_default_checked", + "posthog_team"."path_cleaning_filters", + "posthog_team"."timezone", + "posthog_team"."data_attributes", + "posthog_team"."person_display_name_properties", + "posthog_team"."live_events_columns", + "posthog_team"."recording_domains", + "posthog_team"."primary_dashboard_id", + "posthog_team"."extra_settings", + "posthog_team"."correlation_config", + "posthog_team"."session_recording_retention_period_days", + "posthog_team"."plugins_opt_in", + "posthog_team"."opt_out_capture", + "posthog_team"."event_names", + "posthog_team"."event_names_with_usage", + "posthog_team"."event_properties", + "posthog_team"."event_properties_with_usage", + "posthog_team"."event_properties_numerical" + FROM "posthog_team" + WHERE "posthog_team"."id" = 2 + LIMIT 21 + ' +--- +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99 + ' + 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"."is_active", + "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"."email_opt_in", + "posthog_user"."partial_notification_settings", + "posthog_user"."anonymize_data", + "posthog_user"."toolbar_mode", + "posthog_user"."events_column_config" + FROM "posthog_user" + WHERE "posthog_user"."id" = 2 + LIMIT 21 /**/ + ' +---