diff --git a/ee/session_recordings/session_recording_extensions.py b/ee/session_recordings/session_recording_extensions.py index cb67977b0c3ba..5c44106ff2a1c 100644 --- a/ee/session_recordings/session_recording_extensions.py +++ b/ee/session_recordings/session_recording_extensions.py @@ -10,10 +10,9 @@ from sentry_sdk import capture_exception, capture_message from posthog import settings -from posthog.event_usage import report_team_action from posthog.session_recordings.models.metadata import PersistedRecordingV1 from posthog.session_recordings.models.session_recording import SessionRecording -from posthog.session_recordings.session_recording_helpers import compress_to_string, decompress +from posthog.session_recordings.session_recording_helpers import decompress from posthog.storage import object_storage logger = structlog.get_logger(__name__) @@ -60,8 +59,6 @@ def persist_recording(recording_id: str, team_id: int) -> None: logger.info("Persisting recording: init", recording_id=recording_id, team_id=team_id) - start_time = timezone.now() - if not settings.OBJECT_STORAGE_ENABLED: return @@ -104,49 +101,7 @@ def persist_recording(recording_id: str, team_id: int) -> None: logger.info("Persisting recording: done!", recording_id=recording_id, team_id=team_id, source="s3") return else: - # TODO this can be removed when we're happy with the new storage version - with SNAPSHOT_PERSIST_TIME_HISTOGRAM.labels(source="ClickHouse").time(): - recording.load_snapshots(100_000) # TODO: Paginate rather than hardcode a limit - - content: PersistedRecordingV1 = { - "version": "2022-12-22", - "distinct_id": recording.distinct_id, - "snapshot_data_by_window_id": recording.snapshot_data_by_window_id, - } - - string_content = json.dumps(content, default=str) - string_content = compress_to_string(string_content) - - logger.info("Persisting recording: writing to S3...", recording_id=recording_id, team_id=team_id) - - try: - object_path = recording.build_object_storage_path("2022-12-22") - object_storage.write(object_path, string_content.encode("utf-8")) - recording.object_storage_path = object_path - recording.save() - - report_team_action( - recording.team, - "session recording persisted", - {"total_time_ms": (timezone.now() - start_time).total_seconds() * 1000}, - ) - - logger.info( - "Persisting recording: done!", recording_id=recording_id, team_id=team_id, source="ClickHouse" - ) - except object_storage.ObjectStorageError as ose: - capture_exception(ose) - report_team_action( - recording.team, - "session recording persist failed", - {"total_time_ms": (timezone.now() - start_time).total_seconds() * 1000, "error": str(ose)}, - ) - logger.error( - "session_recording.object-storage-error", - recording_id=recording.session_id, - exception=ose, - exc_info=True, - ) + raise NotImplementedError("ClickHouse backed recordings are not supported") def load_persisted_recording(recording: SessionRecording) -> Optional[PersistedRecordingV1]: diff --git a/ee/session_recordings/test/test_session_recording_extensions.py b/ee/session_recordings/test/test_session_recording_extensions.py index 86b5b5ba2134d..4583f7dacdd9e 100644 --- a/ee/session_recordings/test/test_session_recording_extensions.py +++ b/ee/session_recordings/test/test_session_recording_extensions.py @@ -13,9 +13,8 @@ persist_recording, save_recording_with_new_content, ) +from posthog.models.signals import mute_selected_signals from posthog.session_recordings.models.session_recording import SessionRecording -from posthog.session_recordings.models.session_recording_playlist import SessionRecordingPlaylist -from posthog.session_recordings.models.session_recording_playlist_item import SessionRecordingPlaylistItem from posthog.session_recordings.queries.test.session_replay_sql import produce_replay_summary from posthog.session_recordings.test.test_factory import create_session_recording_events from posthog.settings import ( @@ -64,8 +63,8 @@ def create_snapshot(self, session_id, timestamp): session_id=session_id, window_id="window_1", snapshots=[snapshot], - use_recording_table=True, - use_replay_table=False, + use_recording_table=False, + use_replay_table=True, ) def test_does_not_persist_too_recent_recording(self): @@ -78,62 +77,6 @@ def test_does_not_persist_too_recent_recording(self): assert not recording.object_storage_path - def test_persists_recording_with_original_version_when_not_in_blob_storage(self): - two_minutes_ago = (datetime.now() - timedelta(minutes=2)).replace(tzinfo=timezone.utc) - with freeze_time(two_minutes_ago): - recording = SessionRecording.objects.create( - team=self.team, session_id=f"test_persists_recording-s1-{uuid4()}" - ) - - self.create_snapshot(recording.session_id, recording.created_at - timedelta(hours=48)) - self.create_snapshot(recording.session_id, recording.created_at - timedelta(hours=46)) - - produce_replay_summary( - session_id=recording.session_id, - team_id=self.team.pk, - first_timestamp=(recording.created_at - timedelta(hours=48)).isoformat(), - last_timestamp=(recording.created_at - timedelta(hours=46)).isoformat(), - distinct_id="distinct_id_1", - first_url="https://app.posthog.com/my-url", - ) - - persist_recording(recording.session_id, recording.team_id) - recording.refresh_from_db() - - assert ( - recording.object_storage_path - == f"session_recordings_lts/team-{self.team.pk}/session-{recording.session_id}" - ) - assert recording.start_time == recording.created_at - timedelta(hours=48) - assert recording.end_time == recording.created_at - timedelta(hours=46) - - assert recording.distinct_id == "distinct_id_1" - assert recording.duration == 7200 - assert recording.click_count == 0 - assert recording.keypress_count == 0 - assert recording.start_url == "https://app.posthog.com/my-url" - - assert load_persisted_recording(recording) == { - "version": "2022-12-22", - "distinct_id": "distinct_id_1", - "snapshot_data_by_window_id": { - "window_1": [ - { - "timestamp": (recording.created_at - timedelta(hours=48)).timestamp() * 1000, - "has_full_snapshot": 1, - "type": 2, - "data": {"source": 0, "href": long_url}, - }, - { - "timestamp": (recording.created_at - timedelta(hours=46)).timestamp() * 1000, - "has_full_snapshot": 1, - "type": 2, - "data": {"source": 0, "href": long_url}, - }, - ] - }, - } - def test_can_build_different_object_storage_paths(self) -> None: produce_replay_summary( session_id="test_can_build_different_object_storage_paths-s1", @@ -205,42 +148,10 @@ def test_persists_recording_from_blob_ingested_storage(self): f"{recording.build_object_storage_path('2023-08-01')}/c", ] - @patch("ee.session_recordings.session_recording_extensions.report_team_action") - def test_persist_tracks_correct_to_posthog(self, mock_capture): - two_minutes_ago = (datetime.now() - timedelta(minutes=2)).replace(tzinfo=timezone.utc) - - with freeze_time(two_minutes_ago): - playlist = SessionRecordingPlaylist.objects.create(team=self.team, name="playlist", created_by=self.user) - recording = SessionRecording.objects.create( - team=self.team, session_id=f"test_persist_tracks_correct_to_posthog-s1-{uuid4()}" - ) - SessionRecordingPlaylistItem.objects.create(playlist=playlist, recording=recording) - - self.create_snapshot(recording.session_id, recording.created_at - timedelta(hours=48)) - self.create_snapshot(recording.session_id, recording.created_at - timedelta(hours=46)) - - produce_replay_summary( - session_id=recording.session_id, - team_id=self.team.pk, - first_timestamp=(recording.created_at - timedelta(hours=48)).isoformat(), - last_timestamp=(recording.created_at - timedelta(hours=46)).isoformat(), - distinct_id="distinct_id_1", - first_url="https://app.posthog.com/my-url", - ) - - persist_recording(recording.session_id, recording.team_id) - - assert mock_capture.call_args_list[0][0][0] == recording.team - assert mock_capture.call_args_list[0][0][1] == "session recording persisted" - - for x in [ - "total_time_ms", - ]: - assert mock_capture.call_args_list[0][0][2][x] > 0 - @patch("ee.session_recordings.session_recording_extensions.object_storage.write") def test_can_save_content_to_new_location(self, mock_write: MagicMock): - with self.settings(OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_FOLDER=TEST_BUCKET): + # mute selected signals so the post create signal does not try to persist the recording + with self.settings(OBJECT_STORAGE_SESSION_RECORDING_BLOB_INGESTION_FOLDER=TEST_BUCKET), mute_selected_signals(): session_id = f"{uuid4()}" recording = SessionRecording.objects.create( diff --git a/ee/session_recordings/test/test_session_recording_playlist.py b/ee/session_recordings/test/test_session_recording_playlist.py index ddbb4d1195bca..ac233d6f3a380 100644 --- a/ee/session_recordings/test/test_session_recording_playlist.py +++ b/ee/session_recordings/test/test_session_recording_playlist.py @@ -166,14 +166,16 @@ def test_filters_based_on_params(self): assert len(results) == 1 assert results[0]["short_id"] == playlist3.short_id - def test_get_pinned_recordings_for_playlist(self): + @patch("ee.session_recordings.session_recording_extensions.object_storage.copy_objects") + def test_get_pinned_recordings_for_playlist(self, mock_copy_objects: MagicMock) -> None: + mock_copy_objects.return_value = 2 + playlist = SessionRecordingPlaylist.objects.create(team=self.team, name="playlist", created_by=self.user) session_one = f"test_fetch_playlist_recordings-session1-{uuid4()}" session_two = f"test_fetch_playlist_recordings-session2-{uuid4()}" three_days_ago = (datetime.now() - timedelta(days=3)).replace(tzinfo=timezone.utc) - # can't immediately switch playlists to replay table create_session_recording_events( team_id=self.team.id, distinct_id="123", diff --git a/posthog/session_recordings/models/session_recording.py b/posthog/session_recordings/models/session_recording.py index 65dd13b913257..ed7be73c2c208 100644 --- a/posthog/session_recordings/models/session_recording.py +++ b/posthog/session_recordings/models/session_recording.py @@ -1,21 +1,21 @@ from typing import Any, List, Optional, Literal +from django.conf import settings from django.db import models from django.db.models import Count -from django.dispatch import receiver from posthog.celery import ee_persist_single_recording from posthog.models.person.person import Person +from posthog.models.signals import mutable_receiver +from posthog.models.team.team import Team +from posthog.models.utils import UUIDModel from posthog.session_recordings.models.metadata import ( DecompressedRecordingData, RecordingMatchingEvents, RecordingMetadata, ) from posthog.session_recordings.models.session_recording_event import SessionRecordingViewed -from posthog.models.team.team import Team -from posthog.models.utils import UUIDModel from posthog.session_recordings.queries.session_replay_events import SessionReplayEvents -from django.conf import settings class SessionRecording(UUIDModel): @@ -98,19 +98,14 @@ def load_metadata(self) -> bool: return True def load_snapshots(self, limit=20, offset=0) -> None: - from posthog.session_recordings.queries.session_recording_events import SessionRecordingEvents - if self._snapshots: return if self.object_storage_path: self.load_object_data() else: - snapshots = SessionRecordingEvents( - team=self.team, session_recording_id=self.session_id, recording_start_time=self.start_time - ).get_snapshots(limit, offset) - - self._snapshots = snapshots + # TODO this can be removed + raise NotImplementedError("Clickhouse backed snapshots are not supported") def load_object_data(self) -> None: """ @@ -245,7 +240,7 @@ def set_start_url_from_urls(self, urls: Optional[List[str]] = None, first_url: O self.start_url = url.split("?")[0][:512] if url else None -@receiver(models.signals.post_save, sender=SessionRecording) +@mutable_receiver(models.signals.post_save, sender=SessionRecording) def attempt_persist_recording(sender, instance: SessionRecording, created: bool, **kwargs): if created: ee_persist_single_recording.delay(instance.session_id, instance.team_id) diff --git a/posthog/session_recordings/queries/session_recording_events.py b/posthog/session_recordings/queries/session_recording_events.py deleted file mode 100644 index 826fb2a770ab0..0000000000000 --- a/posthog/session_recordings/queries/session_recording_events.py +++ /dev/null @@ -1,87 +0,0 @@ -import json -from datetime import datetime -from typing import Dict, List, Optional, Tuple - -from posthog.client import sync_execute -from posthog.models import Team -from posthog.session_recordings.models.metadata import ( - DecompressedRecordingData, - SessionRecordingEvent, - SnapshotDataTaggedWithWindowId, -) -from posthog.session_recordings.session_recording_helpers import ( - decompress_chunked_snapshot_data, -) - - -class SessionRecordingEvents: - _session_recording_id: str - _recording_start_time: Optional[datetime] - _team: Team - - def __init__(self, session_recording_id: str, team: Team, recording_start_time: Optional[datetime] = None) -> None: - self._session_recording_id = session_recording_id - self._team = team - self._recording_start_time = recording_start_time - - _recording_snapshot_query = """ - SELECT {fields} - FROM session_recording_events - PREWHERE - team_id = %(team_id)s - AND session_id = %(session_id)s - {date_clause} - ORDER BY timestamp - {limit_param} - """ - - def _get_recording_snapshot_date_clause(self) -> Tuple[str, Dict]: - if self._recording_start_time: - # If we can, we want to limit the time range being queried. - # Theoretically, we shouldn't have to look before the recording start time, - # but until we straighten out the recording start time logic, we should have a buffer - return ( - """ - AND toTimeZone(toDateTime(timestamp, 'UTC'), %(timezone)s) >= toDateTime(%(start_time)s, %(timezone)s) - INTERVAL 1 DAY - AND toTimeZone(toDateTime(timestamp, 'UTC'), %(timezone)s) <= toDateTime(%(start_time)s, %(timezone)s) + INTERVAL 2 DAY - """, - {"start_time": self._recording_start_time, "timezone": self._team.timezone}, - ) - return ("", {}) - - def _query_recording_snapshots(self, include_snapshots=False) -> List[SessionRecordingEvent]: - fields = ["session_id", "window_id", "distinct_id", "timestamp", "events_summary"] - if include_snapshots: - fields.append("snapshot_data") - - date_clause, date_clause_params = self._get_recording_snapshot_date_clause() - query = self._recording_snapshot_query.format(date_clause=date_clause, fields=", ".join(fields), limit_param="") - - response = sync_execute( - query, {"team_id": self._team.id, "session_id": self._session_recording_id, **date_clause_params} - ) - - return [ - SessionRecordingEvent( - session_id=columns[0], - window_id=columns[1], - distinct_id=columns[2], - timestamp=columns[3], - events_summary=[json.loads(x) for x in columns[4]] if columns[4] else [], - snapshot_data=json.loads(columns[5]) if len(columns) > 5 else None, - ) - for columns in response - ] - - def get_snapshots(self, limit, offset) -> Optional[DecompressedRecordingData]: - all_snapshots = [ - SnapshotDataTaggedWithWindowId( - window_id=recording_snapshot["window_id"], snapshot_data=recording_snapshot["snapshot_data"] - ) - for recording_snapshot in self._query_recording_snapshots(include_snapshots=True) - ] - decompressed = decompress_chunked_snapshot_data(all_snapshots, limit, offset) - - if decompressed["snapshot_data_by_window_id"] == {}: - return None - return decompressed diff --git a/posthog/session_recordings/queries/test/test_session_recording.py b/posthog/session_recordings/queries/test/test_session_recording.py deleted file mode 100644 index 28f992fabebd8..0000000000000 --- a/posthog/session_recordings/queries/test/test_session_recording.py +++ /dev/null @@ -1,221 +0,0 @@ -from urllib.parse import urlencode - -from dateutil.relativedelta import relativedelta -from django.http import HttpRequest -from django.utils.timezone import now -from freezegun import freeze_time -from rest_framework.request import Request - -from posthog.models import Filter -from posthog.models.team import Team -from posthog.session_recordings.queries.session_recording_events import SessionRecordingEvents -from posthog.session_recordings.session_recording_helpers import ( - DecompressedRecordingData, -) -from posthog.session_recordings.test.test_factory import create_snapshots, create_snapshot -from posthog.test.base import APIBaseTest, ClickhouseTestMixin - - -def create_recording_filter(session_recording_id, limit=None, offset=None) -> Filter: - params = {} - if limit: - params["limit"] = limit - if offset: - params["offset"] = offset - build_req = HttpRequest() - build_req.META = {"HTTP_HOST": "www.testserver"} - - req = Request( - build_req, f"/api/event/session_recording?session_recording_id={session_recording_id}{urlencode(params)}" # type: ignore - ) - return Filter(request=req, data=params) - - -class TestClickhouseSessionRecording(ClickhouseTestMixin, APIBaseTest): - - maxDiff = None - - def test_get_snapshots(self): - with freeze_time("2020-09-13T12:26:40.000Z"): - create_snapshot( - has_full_snapshot=False, - distinct_id="user", - session_id="1", - timestamp=now(), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - create_snapshot( - has_full_snapshot=False, - distinct_id="user", - session_id="1", - timestamp=now() + relativedelta(seconds=10), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - create_snapshot( - has_full_snapshot=False, - distinct_id="user2", - session_id="2", - timestamp=now() + relativedelta(seconds=20), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - create_snapshot( - has_full_snapshot=False, - distinct_id="user", - session_id="1", - timestamp=now() + relativedelta(seconds=30), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - - filter = create_recording_filter("1") - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id="1" - ).get_snapshots(filter.limit, filter.offset) - - assert recording is not None - self.assertEqual( - recording["snapshot_data_by_window_id"], - { - "": [ - {"timestamp": 1600000000000, "type": 3, "data": {"source": 0}}, - {"timestamp": 1600000010000, "type": 3, "data": {"source": 0}}, - {"timestamp": 1600000030000, "type": 3, "data": {"source": 0}}, - ] - }, - ) - self.assertEqual(recording["has_next"], False) - - def test_get_snapshots_does_not_leak_teams(self): - with freeze_time("2020-09-13T12:26:40.000Z"): - another_team = Team.objects.create(organization=self.organization) - create_snapshot( - has_full_snapshot=False, - distinct_id="user1", - session_id="1", - timestamp=now() + relativedelta(seconds=10), - team_id=another_team.pk, - data={"source": "other team"}, - use_replay_table=False, - use_recording_table=True, - ) - create_snapshot( - has_full_snapshot=False, - distinct_id="user2", - session_id="1", - timestamp=now(), - team_id=self.team.id, - data={"source": 0}, - use_replay_table=False, - use_recording_table=True, - ) - - filter = create_recording_filter("1") - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id="1" - ).get_snapshots(filter.limit, filter.offset) - - assert recording is not None - self.assertEqual( - recording["snapshot_data_by_window_id"], - {"": [{"data": {"source": 0}, "timestamp": 1600000000000, "type": 3}]}, - ) - - def test_get_snapshots_with_no_such_session(self): - filter = create_recording_filter("xxx") - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id="xxx" - ).get_snapshots(filter.limit, filter.offset) - - assert recording is None - - def test_get_chunked_snapshots(self): - with freeze_time("2020-09-13T12:26:40.000Z"): - chunked_session_id = "7" - snapshots_per_chunk = 2 - limit = 20 - for _ in range(30): - create_snapshots( - snapshot_count=snapshots_per_chunk, - distinct_id="user", - session_id=chunked_session_id, - timestamp=now(), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - - filter = create_recording_filter(chunked_session_id) - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id=chunked_session_id - ).get_snapshots(limit, filter.offset) - - assert recording is not None - self.assertEqual(len(recording["snapshot_data_by_window_id"][""]), limit * snapshots_per_chunk) - self.assertTrue(recording["has_next"]) - - def test_get_chunked_snapshots_with_specific_limit_and_offset(self): - with freeze_time("2020-09-13T12:26:40.000Z"): - chunked_session_id = "7" - limit = 10 - offset = 5 - snapshots_per_chunk = 2 - for index in range(16): - create_snapshots( - snapshot_count=snapshots_per_chunk, - distinct_id="user", - session_id=chunked_session_id, - timestamp=now() + relativedelta(minutes=index), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - - filter = create_recording_filter(chunked_session_id, limit, offset) - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id=chunked_session_id - ).get_snapshots(limit, filter.offset) - - assert recording is not None - self.assertEqual(len(recording["snapshot_data_by_window_id"][""]), limit * snapshots_per_chunk) - self.assertEqual(recording["snapshot_data_by_window_id"][""][0]["timestamp"], 1_600_000_300_000) - self.assertTrue(recording["has_next"]) - - def test_get_snapshots_with_date_filter(self): - with freeze_time("2020-09-13T12:26:40.000Z"): - # This snapshot should be filtered out - create_snapshot( - has_full_snapshot=False, - distinct_id="user", - session_id="1", - timestamp=now() - relativedelta(days=2), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - # This snapshot should appear - create_snapshot( - has_full_snapshot=False, - distinct_id="user", - session_id="1", - timestamp=now(), - team_id=self.team.id, - use_replay_table=False, - use_recording_table=True, - ) - - filter = create_recording_filter( - "1", - ) - recording: DecompressedRecordingData | None = SessionRecordingEvents( - team=self.team, session_recording_id="1", recording_start_time=now() - ).get_snapshots(filter.limit, filter.offset) - - assert recording is not None - self.assertEqual(len(recording["snapshot_data_by_window_id"][""]), 1) diff --git a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr index 78ea1c1d6f5b6..a9f66096059e3 100644 --- a/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr +++ b/posthog/session_recordings/test/__snapshots__/test_session_recordings.ambr @@ -83,6 +83,59 @@ ' --- # 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 ('5', + '4', + '1', + '3', + '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.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", @@ -104,11 +157,12 @@ WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', 'user2', 'user3', - 'user4') + '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.101 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -123,7 +177,7 @@ 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.102 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.105 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -174,7 +228,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.103 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.106 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -203,7 +257,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.104 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.107 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -247,7 +301,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.105 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.108 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -276,46 +330,13 @@ 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.106 - ' - 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.107 - ' - 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.108 - ' - 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.109 ' 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'*/ ' @@ -326,7 +347,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_ENABLED' + 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'*/ ' @@ -337,7 +358,7 @@ "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'*/ ' @@ -348,7 +369,7 @@ "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'*/ ' @@ -359,7 +380,7 @@ "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'*/ ' @@ -370,7 +391,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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'*/ ' @@ -381,7 +402,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' + 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'*/ ' @@ -403,7 +424,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_ENABLED' + 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'*/ ' @@ -425,7 +446,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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'*/ ' @@ -459,7 +480,8 @@ '4', '1', '3', - '2') + '2', + '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'*/ ' @@ -470,7 +492,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' + 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'*/ ' @@ -506,7 +528,8 @@ 'user2', 'user3', 'user4', - 'user5') + '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'*/ ' --- @@ -772,7 +795,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_ENABLED' + 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'*/ ' @@ -783,7 +806,7 @@ "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' + 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'*/ ' @@ -800,50 +823,6 @@ ' --- # name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.137 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.138 - ' - 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.139 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.14 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.140 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -873,12 +852,13 @@ '1', '3', '2', + '7', '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.141 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.138 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -886,7 +866,7 @@ 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.142 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.139 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -910,11 +890,20 @@ 'user3', 'user4', 'user5', - 'user6') + '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.143 +# 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", @@ -929,7 +918,7 @@ 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.144 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.141 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -980,7 +969,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.142 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1009,7 +998,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.146 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.143 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1053,7 +1042,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.147 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.144 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1082,7 +1071,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.148 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.145 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1093,7 +1082,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.146 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1104,18 +1093,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_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.150 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.147 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1126,7 +1104,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.148 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1137,7 +1115,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.149 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1148,106 +1126,113 @@ 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 - ' - 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.154 - ' - 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.155 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.156 - ' - 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.15 ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157 + 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"."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 ' 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.158 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.151 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.159 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.152 ' 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.16 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.153 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.160 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.154 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.161 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.155 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -1275,6 +1260,7 @@ WHERE ("posthog_sessionrecording"."session_id" IN ('5', '4', '1', + '8', '3', '2', '7', @@ -1283,7 +1269,7 @@ 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.162 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.156 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -1291,7 +1277,7 @@ 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.163 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.157 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -1316,11 +1302,12 @@ 'user4', 'user5', 'user6', - 'user7') + '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.164 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.158 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -1335,7 +1322,7 @@ 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.165 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.159 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1386,7 +1373,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.166 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.16 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1415,7 +1402,36 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.160 + ' + 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.161 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1459,7 +1475,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.168 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.162 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1488,7 +1504,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.169 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.163 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1499,15 +1515,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_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.170 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.164 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1518,7 +1526,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.165 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1529,7 +1537,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.166 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1540,7 +1548,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 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.167 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1551,7 +1559,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.174 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.168 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1562,40 +1570,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.175 - ' - 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.176 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.177 - ' - 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.178 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.169 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1606,18 +1581,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.179 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.18 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.17 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1655,20 +1619,24 @@ "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" + "posthog_team"."session_recording_retention_period_days" FROM "posthog_team" WHERE "posthog_team"."id" = 2 - LIMIT 21 + 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.180 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.170 + ' + 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.171 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1679,18 +1647,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.181 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.172 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.182 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.173 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -1722,12 +1690,13 @@ '3', '2', '7', + '9', '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.183 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.174 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -1735,7 +1704,7 @@ 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.184 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.175 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -1761,11 +1730,12 @@ 'user5', 'user6', 'user7', - 'user8') + '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.185 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.176 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -1780,7 +1750,7 @@ 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.186 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.177 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1831,7 +1801,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.187 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.178 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -1860,7 +1830,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.188 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.179 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -1904,7 +1874,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.189 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.18 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -1933,36 +1903,36 @@ 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.19 - ' - 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.180 ' ---- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.190 + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", + "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."customer_id", + "posthog_organization"."available_features", + "posthog_organization"."available_product_features", + "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", @@ -1973,7 +1943,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.191 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.182 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1984,7 +1954,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.192 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.183 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -1995,7 +1965,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.193 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.184 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2006,7 +1976,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.194 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.185 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2017,7 +1987,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.195 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.186 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2028,7 +1998,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.196 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.187 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2039,18 +2009,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.197 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.198 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.188 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2061,7 +2020,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.199 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.189 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2072,91 +2031,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.2 - ' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."customer_id", - "posthog_organization"."available_features", - "posthog_organization"."available_product_features", - "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.20 - ' - 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"."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.200 +# 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:MATERIALIZED_COLUMNS_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.201 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.190 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2167,18 +2053,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.202 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.203 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.191 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -2211,12 +2086,13 @@ '2', '7', '9', - '6') + '6', + '10') 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.204 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.192 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -2224,7 +2100,7 @@ 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.205 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.193 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -2244,6 +2120,7 @@ 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', @@ -2255,7 +2132,7 @@ 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.206 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.194 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -2270,160 +2147,7 @@ 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.207 - ' - 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"."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.208 - ' - 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.209 - ' - 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"."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.21 - ' - SELECT "posthog_organizationmembership"."id", - "posthog_organizationmembership"."organization_id", - "posthog_organizationmembership"."user_id", - "posthog_organizationmembership"."level", - "posthog_organizationmembership"."joined_at", - "posthog_organizationmembership"."updated_at", - "posthog_organization"."id", - "posthog_organization"."name", - "posthog_organization"."slug", - "posthog_organization"."created_at", - "posthog_organization"."updated_at", - "posthog_organization"."plugins_access_level", - "posthog_organization"."for_internal_metrics", - "posthog_organization"."is_member_join_email_enabled", - "posthog_organization"."enforce_2fa", - "posthog_organization"."customer_id", - "posthog_organization"."available_features", - "posthog_organization"."available_product_features", - "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.210 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.2 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -2452,18 +2176,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.211 - ' - 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.212 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.20 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2474,7 +2187,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.213 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.21 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2485,7 +2198,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.214 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.22 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2496,7 +2209,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.215 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.23 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2507,7 +2220,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.216 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.24 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2518,7 +2231,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.217 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.25 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2529,18 +2242,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.218 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.219 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.26 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2551,18 +2253,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 - ' - 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.220 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.27 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2573,18 +2264,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.221 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.222 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.28 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2595,18 +2275,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.223 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.224 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.29 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -2631,21 +2300,23 @@ 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 ('5', - '4', - '1', - '8', - '3', - '2', - '7', - '9', - '6', - '10') + 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.225 +# 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: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.30 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -2653,7 +2324,7 @@ 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.226 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.31 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -2672,134 +2343,256 @@ "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') + 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.227 +# 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 + ' + 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"."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.34 ' - 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_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.23 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.35 ' - 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'*/ + 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"."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.24 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.36 ' - 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'*/ + SELECT "posthog_organizationmembership"."id", + "posthog_organizationmembership"."organization_id", + "posthog_organizationmembership"."user_id", + "posthog_organizationmembership"."level", + "posthog_organizationmembership"."joined_at", + "posthog_organizationmembership"."updated_at", + "posthog_organization"."id", + "posthog_organization"."name", + "posthog_organization"."slug", + "posthog_organization"."created_at", + "posthog_organization"."updated_at", + "posthog_organization"."plugins_access_level", + "posthog_organization"."for_internal_metrics", + "posthog_organization"."is_member_join_email_enabled", + "posthog_organization"."enforce_2fa", + "posthog_organization"."customer_id", + "posthog_organization"."available_features", + "posthog_organization"."available_product_features", + "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.25 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.37 ' 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.26 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.38 ' 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.27 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.39 ' 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.28 +# 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.29 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.40 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.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: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.30 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.42 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:RECORDINGS_TTL_WEEKS' + 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.31 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.43 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2810,18 +2603,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.32 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.44 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_ENABLED' + 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.33 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.45 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -2832,18 +2625,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.34 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.46 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.35 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.47 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -2868,12 +2661,13 @@ 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') + 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.36 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.48 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -2881,7 +2675,7 @@ 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.37 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.49 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -2900,11 +2694,23 @@ "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') + 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.38 +# 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", @@ -2919,7 +2725,7 @@ 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.39 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.51 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -2970,18 +2776,7 @@ LIMIT 21 ' --- -# 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: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.40 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.52 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3010,7 +2805,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.41 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.53 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3054,7 +2849,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.42 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.54 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3083,7 +2878,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.43 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.55 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3094,7 +2889,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.56 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3105,7 +2900,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.57 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3116,7 +2911,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.58 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3127,7 +2922,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 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.59 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3138,29 +2933,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.48 - ' - 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.49 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.6 ' 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.5 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.60 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3171,29 +2955,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.50 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.51 - ' - 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.52 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3204,18 +2966,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.53 +# 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:MATERIALIZED_COLUMNS_ENABLED' + 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.54 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.63 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3226,18 +2988,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.55 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.64 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", "posthog_instancesetting"."raw_value" FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.56 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.65 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -3263,12 +3025,13 @@ FROM "posthog_sessionrecording" LEFT OUTER JOIN "posthog_sessionrecordingplaylistitem" ON ("posthog_sessionrecording"."session_id" = "posthog_sessionrecordingplaylistitem"."recording_id") WHERE ("posthog_sessionrecording"."session_id" IN ('1', + '3', '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.57 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.66 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -3276,7 +3039,7 @@ 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.58 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.67 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -3296,11 +3059,12 @@ FROM "posthog_persondistinctid" INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', - 'user2') + '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.59 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.68 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -3315,18 +3079,7 @@ 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.6 - ' - 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.60 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.69 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3377,7 +3130,18 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.61 +# 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 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3406,7 +3170,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.62 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.71 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3450,7 +3214,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.63 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.72 ' SELECT "posthog_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3479,7 +3243,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.64 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.73 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3490,7 +3254,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.65 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.74 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3501,7 +3265,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.66 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.75 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3512,7 +3276,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.67 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.76 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3523,7 +3287,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.68 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.77 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3534,18 +3298,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.69 - ' - 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.7 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.78 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3556,7 +3309,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.70 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.79 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3567,18 +3320,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.71 +# 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:MATERIALIZED_COLUMNS_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.72 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.80 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3589,7 +3342,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.73 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.81 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3600,18 +3353,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 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.75 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3622,18 +3364,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 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.77 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 ' SELECT "posthog_sessionrecording"."id", "posthog_sessionrecording"."session_id", @@ -3658,14 +3389,15 @@ 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', + WHERE ("posthog_sessionrecording"."session_id" IN ('4', + '1', '3', '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.78 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.84 ' SELECT "posthog_sessionrecordingviewed"."session_id" FROM "posthog_sessionrecordingviewed" @@ -3673,7 +3405,7 @@ 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.79 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.85 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -3694,22 +3426,12 @@ INNER JOIN "posthog_person" ON ("posthog_persondistinctid"."person_id" = "posthog_person"."id") WHERE ("posthog_persondistinctid"."distinct_id" IN ('user1', 'user2', - 'user3') + '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.8 - ' - 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.80 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.86 ' SELECT "posthog_persondistinctid"."id", "posthog_persondistinctid"."team_id", @@ -3724,7 +3446,7 @@ 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.81 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.87 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3775,7 +3497,7 @@ LIMIT 21 ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.82 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.88 ' SELECT "posthog_user"."id", "posthog_user"."password", @@ -3804,7 +3526,7 @@ LIMIT 21 /**/ ' --- -# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.83 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.89 ' SELECT "posthog_team"."id", "posthog_team"."uuid", @@ -3848,7 +3570,18 @@ 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.84 +# 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_organizationmembership"."id", "posthog_organizationmembership"."organization_id", @@ -3877,7 +3610,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.85 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.91 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3888,7 +3621,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.86 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.92 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3899,7 +3632,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.87 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.93 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3910,7 +3643,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.88 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.94 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3921,7 +3654,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.89 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.95 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3932,18 +3665,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.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.96 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3954,7 +3676,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.91 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.97 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3965,18 +3687,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 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.93 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.98 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -3987,29 +3698,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 - ' - 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.95 - ' - SELECT "posthog_instancesetting"."id", - "posthog_instancesetting"."key", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.96 +# name: TestSessionRecordings.test_listing_recordings_is_not_nplus1_for_persons.99 ' SELECT "posthog_instancesetting"."id", "posthog_instancesetting"."key", @@ -4020,55 +3709,3 @@ 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", - "posthog_instancesetting"."raw_value" - FROM "posthog_instancesetting" - WHERE "posthog_instancesetting"."key" = 'constance:posthog:MATERIALIZED_COLUMNS_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.98 - ' - 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 ('4', - '1', - '3', - '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.99 - ' - 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'*/ - ' ---- diff --git a/posthog/session_recordings/test/test_lts_session_recordings.py b/posthog/session_recordings/test/test_lts_session_recordings.py index b98286e045f25..57cd3e8cba18d 100644 --- a/posthog/session_recordings/test/test_lts_session_recordings.py +++ b/posthog/session_recordings/test/test_lts_session_recordings.py @@ -3,6 +3,7 @@ from unittest.mock import patch, MagicMock, call, Mock from posthog.models import Team +from posthog.models.signals import mute_selected_signals from posthog.session_recordings.models.session_recording import SessionRecording from posthog.test.base import APIBaseTest, ClickhouseTestMixin, QueryMatchingTest @@ -78,19 +79,15 @@ def list_objects_func(path: str) -> List[str]: mock_list_objects.side_effect = list_objects_func - recording = SessionRecording.objects.create( - team=self.team, - session_id=session_id, - # to avoid auto-persistence kicking in when this is None - storage_version="not a know version", - object_storage_path=lts_storage_path, - start_time="1970-01-01T00:00:00.001000Z", - end_time="1970-01-01T00:00:00.002000Z", - ) - # why is this necessary? I don't know... - # but without it, the object has the default storage path 🤷️ - recording.object_storage_path = lts_storage_path - recording.save() + with mute_selected_signals(): + SessionRecording.objects.create( + team=self.team, + session_id=session_id, + storage_version=None, + object_storage_path=lts_storage_path, + start_time="1970-01-01T00:00:00.001000Z", + end_time="1970-01-01T00:00:00.002000Z", + ) response = self.client.get(f"/api/projects/{self.team.id}/session_recordings/{session_id}/snapshots?version=2") response_data = response.json() @@ -198,18 +195,16 @@ def list_objects_func(path: str) -> List[str]: mock_requests.return_value.__enter__.return_value = mock_response mock_requests.return_value.__exit__.return_value = None - recording = SessionRecording.objects.create( - team=self.team, - session_id=session_id, - # to avoid auto-persistence kicking in when this is None - storage_version="not a know version", - object_storage_path=lts_storage_path, - start_time="1970-01-01T00:00:00.001000Z", - end_time="1970-01-01T00:00:00.002000Z", - ) - # something in the setup is triggering a path that saves the recording without the provided path so - recording.object_storage_path = lts_storage_path - recording.save() + with mute_selected_signals(): + SessionRecording.objects.create( + team=self.team, + session_id=session_id, + # to avoid auto-persistence kicking in when this is None + storage_version="not a know version", + object_storage_path=lts_storage_path, + start_time="1970-01-01T00:00:00.001000Z", + end_time="1970-01-01T00:00:00.002000Z", + ) query_parameters = [ "source=blob", diff --git a/posthog/session_recordings/test/test_session_recordings.py b/posthog/session_recordings/test/test_session_recordings.py index a535fba873f09..14820ba9df997 100644 --- a/posthog/session_recordings/test/test_session_recordings.py +++ b/posthog/session_recordings/test/test_session_recordings.py @@ -369,82 +369,6 @@ def test_get_single_session_recording_metadata(self): "storage": "clickhouse", } - def test_get_default_limit_of_chunks(self): - # TODO import causes circular reference... but we're going to delete this soon so... - from posthog.session_recordings.session_recording_api import DEFAULT_RECORDING_CHUNK_LIMIT - - base_time = now() - num_snapshots = DEFAULT_RECORDING_CHUNK_LIMIT + 10 - - for _ in range(num_snapshots): - self.create_snapshot("user", "1", base_time, use_recording_table=True, use_replay_table=False) - - response = self.client.get(f"/api/projects/{self.team.id}/session_recordings/1/snapshots") - response_data = response.json() - self.assertEqual(len(response_data["snapshot_data_by_window_id"][""]), DEFAULT_RECORDING_CHUNK_LIMIT) - - def test_get_snapshots_is_compressed(self): - base_time = now() - num_snapshots = 2 # small contents aren't compressed, needs to be enough data to trigger compression - - for _ in range(num_snapshots): - self.create_snapshot("user", "1", base_time, use_recording_table=True) - - custom_headers = {"HTTP_ACCEPT_ENCODING": "gzip"} - response = self.client.get( - f"/api/projects/{self.team.id}/session_recordings/1/snapshots", - data=None, - follow=False, - secure=False, - **custom_headers, - ) - - self.assertEqual(response.status_code, status.HTTP_200_OK) - self.assertEqual(response.headers.get("Content-Encoding", None), "gzip") - - def test_get_snapshots_for_chunked_session_recording(self): - # TODO import causes circular reference... but we're going to delete this soon so... - from posthog.session_recordings.session_recording_api import DEFAULT_RECORDING_CHUNK_LIMIT - - chunked_session_id = "chunk_id" - expected_num_requests = 3 - num_chunks = 60 - snapshots_per_chunk = 2 - - with freeze_time("2020-09-13T12:26:40.000Z"): - start_time = now() - for index, s in enumerate(range(num_chunks)): - self.create_snapshots( - snapshots_per_chunk, - "user", - chunked_session_id, - start_time + relativedelta(minutes=s), - window_id="1" if index % 2 == 0 else "2", - use_recording_table=True, - use_replay_table=False, - ) - - next_url = f"/api/projects/{self.team.id}/session_recordings/{chunked_session_id}/snapshots" - - for i in range(expected_num_requests): - response = self.client.get(next_url) - response_data = response.json() - - self.assertEqual( - len(response_data["snapshot_data_by_window_id"]["1"]), - snapshots_per_chunk * DEFAULT_RECORDING_CHUNK_LIMIT / 2, - ) - self.assertEqual( - len(response_data["snapshot_data_by_window_id"]["2"]), - snapshots_per_chunk * DEFAULT_RECORDING_CHUNK_LIMIT / 2, - ) - if i == expected_num_requests - 1: - self.assertIsNone(response_data["next"]) - else: - self.assertIsNotNone(response_data["next"]) - - next_url = response_data["next"] - def test_single_session_recording_doesnt_leak_teams(self): another_team = Team.objects.create(organization=self.organization) self.create_snapshot("user", "id_no_team_leaking", now() - relativedelta(days=1), team_id=another_team.pk) @@ -524,38 +448,6 @@ def test_empty_list_session_ids_filter_returns_no_recordings(self): self.assertEqual(len(response_data["results"]), 0) - def test_regression_encoded_emojis_dont_crash(self): - - Person.objects.create( - team=self.team, distinct_ids=["user"], properties={"$some_prop": "something", "email": "bob@bob.com"} - ) - with freeze_time("2022-01-01T12:00:00.000Z"): - self.create_snapshot( - "user", - "1", - now() - relativedelta(days=1), - # TODO do we need a version of this that writes to blob storage? - snapshot_data={"texts": ["\\ud83d\udc83\\ud83c\\udffb"]}, # This is an invalid encoded emoji - use_recording_table=True, - ) - - response = self.client.get(f"/api/projects/{self.team.id}/session_recordings/1/snapshots") - self.assertEqual(response.status_code, status.HTTP_200_OK) - response_data = response.json() - - assert not response_data["next"] - assert response_data["snapshot_data_by_window_id"] == { - "": [ - { - "texts": ["\\ud83d\udc83\\ud83c\\udffb"], - "timestamp": 1640952000000.0, - "has_full_snapshot": True, - "type": 2, - "data": {"source": 0}, - } - ] - } - def test_delete_session_recording(self): self.create_snapshot("user", "1", now() - relativedelta(days=1), team_id=self.team.pk) response = self.client.delete(f"/api/projects/{self.team.id}/session_recordings/1") @@ -759,13 +651,10 @@ def test_can_not_get_session_recording_blob_that_does_not_exist(self, mock_presi response = self.client.get(url) assert response.status_code == status.HTTP_404_NOT_FOUND - @parameterized.expand( - [ - (False, 3), - (True, 1), - ] - ) - def test_get_via_sharing_token(self, use_recording_events: bool, api_version: int) -> None: + @patch("ee.session_recordings.session_recording_extensions.object_storage.copy_objects") + def test_get_via_sharing_token(self, mock_copy_objects: MagicMock) -> None: + mock_copy_objects.return_value = 2 + other_team = create_team(organization=self.organization) session_id = str(uuid.uuid4()) @@ -775,7 +664,6 @@ def test_get_via_sharing_token(self, use_recording_events: bool, api_version: in session_id, now() - relativedelta(days=1), team_id=self.team.pk, - use_recording_table=use_recording_events, ) token = self.client.patch( @@ -808,9 +696,8 @@ def test_get_via_sharing_token(self, use_recording_events: bool, api_version: in "end_time": "2022-12-31T12:00:00Z", } - # if api_version is three then we should request snapshots with version 2 response = self.client.get( - f"/api/projects/{self.team.id}/session_recordings/{session_id}/snapshots?sharing_access_token={token}&version={api_version-1}" + f"/api/projects/{self.team.id}/session_recordings/{session_id}/snapshots?sharing_access_token={token}&version=2" ) self.assertEqual(response.status_code, status.HTTP_200_OK)