:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(replay): stop loading recordings too large to play (#90545)
Hayne Ryu826f80ccaf31
diff --git a/frontend/src/lib/constants.tsx b/frontend/src/lib/constants.tsxindex bcdefd1693f8..5d0297f29fb1 100644--- a/frontend/src/lib/constants.tsx+++ b/frontend/src/lib/constants.tsx@@ -223,6 +223,7 @@ export const FEATURE_FLAGS = {PERSONLESS_EVENTS_NOT_SUPPORTED: 'personless-events-not-supported', // owner: #team-analytics-platformQUERY_RUNNING_TIME: 'query_running_time', // owner: #team-analytics-platformREPLAY_HOGQL_FILTERS: 'replay-hogql-filters', // owner: @pauldambra #team-replay+ REPLAY_OVERSIZED_RECORDING_GATE: 'replay-oversized-recording-gate', // owner: #team-replayREPLAY_PLAYER_PERSON_SESSIONS_TAB: 'replay-player-person-sessions-tab', // owner: @ksvat #team-replayREPLAY_SETTINGS_HELP: 'replay-settings-help', // owner: @veryayskiy #team-replaySCOUTS_MODEL_CONFIG: 'scouts-model-config', // owner: #team-self-driving, gates the per-scout model pin in the inbox scout settings (also checked server-side)diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex 3bad890ad335..98602280a3c8 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -50141,6 +50141,10 @@"description": "When the recording ends in ISO format.","type": "string"},+ "event_count": {+ "description": "Number of captured rrweb events in the recording. Only present once metadata is loaded.",+ "type": ["number", "null"]+ },"expiry_time": {"description": "When the recording expires, in ISO format.","type": "string"@@ -50212,6 +50216,10 @@"summary": {"type": "string"},+ "total_size": {+ "description": "Total stored size of the recording's snapshot data in bytes. Only present once metadata is loaded.",+ "type": ["number", "null"]+ },"viewed": {"description": "Whether this recording has been viewed by you already.","type": "boolean"diff --git a/frontend/src/scenes/session-recordings/player/PlayerFrameOverlay.tsx b/frontend/src/scenes/session-recordings/player/PlayerFrameOverlay.tsxindex b7c4acd7bf44..331b203cfd77 100644--- a/frontend/src/scenes/session-recordings/player/PlayerFrameOverlay.tsx+++ b/frontend/src/scenes/session-recordings/player/PlayerFrameOverlay.tsx@@ -8,6 +8,7 @@ import { IconEmoji, IconPlay, IconRewindPlay, IconWarning } from '@posthog/iconsimport { IconSkipBackward } from 'lib/lemon-ui/icons'import { LemonButton } from 'lib/lemon-ui/LemonButton'import { cn } from 'lib/utils/css-classes'+import { humanizeBytes } from 'lib/utils/numbers'import { sessionRecordingPlayerLogic } from 'scenes/session-recordings/player/sessionRecordingPlayerLogic'import { urls } from 'scenes/urls'@@ -78,7 +79,7 @@ const RECOVERABLE_SNAPSHOT_ERRORS = []const PlayerFrameOverlayContent = (): JSX.Element | null => {- const { currentPlayerState, endReached, logicProps, playerError, isWaitingForIngestion } =+ const { currentPlayerState, endReached, logicProps, playerError, isWaitingForIngestion, sessionPlayerMetaData } =useValues(sessionRecordingPlayerLogic)const { setPlay, retryLoadingSnapshots } = useActions(sessionRecordingPlayerLogic)@@ -94,7 +95,29 @@ const PlayerFrameOverlayContent = (): JSX.Element | null => {const playerMode = logicProps.mode ?? SessionRecordingPlayerMode.Standardconst showActionsOnOverlay = playerMode === SessionRecordingPlayerMode.Standard && pausedState- if (currentPlayerState === SessionPlayerState.ERROR) {+ if (currentPlayerState === SessionPlayerState.ERROR && playerError === 'recordingTooLarge') {+ const totalSize = sessionPlayerMetaData?.total_size+ content = (+ <div className="flex flex-col justify-center items-center p-6 bg-surface-primary rounded m-6 gap-2 max-w-120 shadow-sm">+ <IconWarning className="text-danger text-5xl" />+ <div className="font-bold text-text-3000 text-lg">We're unable to play this recording</div>+ <div className="text-secondary text-sm text-center">+ It contains {totalSize ? `${humanizeBytes(totalSize)} of` : 'too much'} snapshot data in very large+ chunks, and playing it would freeze this browser tab. This usually comes from pages with rapidly+ changing content. You can exclude those elements from capture to keep future recordings playable.+ </div>+ <LemonButton+ targetBlank+ to="https://posthog.com/docs/session-replay/privacy"+ type="primary"+ fullWidth+ center+ >+ Learn how to exclude elements+ </LemonButton>+ </div>+ )+ } else if (currentPlayerState === SessionPlayerState.ERROR) {const isMissingFullSnapshot = playerError === 'noPlayableFullSnapshot'const isUnauthorized = playerError === 'snapshotUnauthorized'const isRecoverable = !!playerError && RECOVERABLE_SNAPSHOT_ERRORS.includes(playerError)diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.test.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.test.tsindex e56f32cb14c6..d81ea0bbc74e 100644--- a/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.test.ts+++ b/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.test.ts@@ -5,7 +5,9 @@ import { HttpResponse } from 'msw'import { processAllSnapshots, SnapshotSourceType, SourceKey, ViewportResolution } from '@posthog/replay-shared'+import { FEATURE_FLAGS } from 'lib/constants'import { dayjs } from 'lib/dayjs'+import { featureFlagLogic } from 'lib/logic/featureFlagLogic'import { convertSnapshotsByWindowId } from 'scenes/session-recordings/__mocks__/recording_snapshots'import { sessionRecordingDataCoordinatorLogic } from 'scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic'import { sessionRecordingMetaLogic } from 'scenes/session-recordings/player/sessionRecordingMetaLogic'@@ -67,6 +69,67 @@ describe('sessionRecordingDataCoordinatorLogic', () => {})})+ describe('oversized recording gate', () => {+ const oversizedMeta = {+ ...recordingMetaJson,+ snapshot_source: 'web',+ total_size: 40 * 1024 * 1024,+ event_count: 100,+ }++ const mountWithMeta = (+ sessionRecordingId: string,+ meta: Record<string, any>,+ flagEnabled: boolean+ ): ReturnType<typeof sessionRecordingDataCoordinatorLogic.build> => {+ featureFlagLogic.mount()+ featureFlagLogic.actions.setFeatureFlags(+ flagEnabled ? [FEATURE_FLAGS.REPLAY_OVERSIZED_RECORDING_GATE] : [],+ flagEnabled ? { [FEATURE_FLAGS.REPLAY_OVERSIZED_RECORDING_GATE]: true } : {}+ )+ overrideSessionRecordingMocks({+ getMocks: { '/api/environments/:team_id/session_recordings/:id': meta },+ })+ const gatedLogic = sessionRecordingDataCoordinatorLogic({ sessionRecordingId, blobV2PollingDisabled: true })+ gatedLogic.mount()+ gatedLogic.actions.loadRecordingMeta()+ return gatedLogic+ }++ it('never loads snapshots for an unplayably large recording', async () => {+ const gatedLogic = mountWithMeta('oversized-gated', oversizedMeta, true)++ await expectLogic(gatedLogic)+ .toDispatchActions(['loadRecordingMetaSuccess'])+ .toFinishAllListeners()+ .toNotHaveDispatchedActions(['loadSnapshotSources'])+ .toMatchValues({ recordingTooLargeToPlay: true })+ })++ it.each([+ ['the flag is disabled', 'oversized-flag-off', oversizedMeta, false],+ ['the recording is mobile', 'oversized-mobile', { ...oversizedMeta, snapshot_source: 'mobile' }, true],+ [+ 'the recording is large but made of ordinary small events',+ 'oversized-small-events',+ { ...oversizedMeta, event_count: 1_000_000 },+ true,+ ],+ [+ 'the recording is small',+ 'oversized-small',+ { ...oversizedMeta, total_size: 1024, event_count: 10 },+ true,+ ],+ ])('auto-loads snapshots when %s', async (_name, sessionRecordingId, meta, flagEnabled) => {+ const gatedLogic = mountWithMeta(sessionRecordingId, meta, flagEnabled)++ await expectLogic(gatedLogic)+ .toDispatchActions(['loadRecordingMetaSuccess', 'loadSnapshotSources'])+ .toMatchValues({ recordingTooLargeToPlay: false })+ })+ })+describe('loading session core', () => {it('loads all data', async () => {await expectLogic(logic, () => {diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.tsindex ac5d78c65279..f87e8b23869c 100644--- a/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.ts+++ b/frontend/src/scenes/session-recordings/player/sessionRecordingDataCoordinatorLogic.ts@@ -25,7 +25,9 @@ import {SourceLoadingState,} from '@posthog/replay-shared'+import { FEATURE_FLAGS } from 'lib/constants'import { Dayjs, dayjs, now } from 'lib/dayjs'+import { featureFlagLogic, FeatureFlagsSet } from 'lib/logic/featureFlagLogic'import { metricCount } from 'lib/operationalMetrics'import {@@ -56,6 +58,11 @@ import { posthogTelemetry } from './snapshot-processing/process-all-snapshots'import { snapshotDataLogic } from './snapshotDataLogic'import { createSegments, mapSnapshotsToWindowId } from './utils/segmenter'+// Tab-freezing recordings are both large overall and made of huge individual events (giant DOM+// mutations); most large recordings are ordinary small events and play fine, so both must trip+export const OVERSIZED_RECORDING_AUTOLOAD_LIMIT_BYTES = 30 * 1024 * 1024+export const OVERSIZED_RECORDING_AVG_EVENT_BYTES = 100 * 1024+export interface SessionRecordingDataCoordinatorLogicProps {sessionRecordingId: SessionRecordingId// allows disabling polling for new sources in tests@@ -87,6 +94,7 @@ export interface sessionRecordingDataCoordinatorLogicValues {sessionEventsDataLoading: boolean // eventsLogicviewportForTimestamp: (timestamp: number) => ViewportResolution | undefined // eventsLogicwebVitalsEvents: RecordingEventType[] // eventsLogic+ featureFlags: FeatureFlagsSet // featureFlagLogicannotations: AnnotationType[] // metaLogicannotationsLoading: boolean // metaLogiccurrentTeam: TeamPublicType | TeamType | null // metaLogic@@ -117,6 +125,7 @@ export interface sessionRecordingDataCoordinatorLogicValues {isOldAndInvalid: booleanisRecentAndInvalid: booleanprocessedSnapshots: RecordingSnapshot[]+ recordingTooLargeToPlay: booleanreportedLoaded: booleansegments: RecordingSegment[]sessionPlayerData: SessionPlayerData@@ -314,6 +323,10 @@ export interface sessionRecordingDataCoordinatorLogicActions {export interface sessionRecordingDataCoordinatorLogicMeta {key: string__keaTypeGenInternalSelectorTypes: {+ recordingTooLargeToPlay: (+ sessionPlayerMetaData: SessionRecordingType | null,+ featureFlags: FeatureFlagsSet+ ) => booleansnapshots: (processedSnapshots: import('@posthog/replay-shared').RecordingSnapshot[]) => RecordingSnapshot[]start: (snapshots: import('@posthog/replay-shared').RecordingSnapshot[],@@ -490,6 +503,8 @@ export const sessionRecordingDataCoordinatorLogic = kea<sessionRecordingDataCoor],snapLogic,['snapshotStore', 'storeVersion', 'sourceLoadingStates'],+ featureFlagLogic,+ ['featureFlags'],],}}),@@ -524,7 +539,7 @@ export const sessionRecordingDataCoordinatorLogic = kea<sessionRecordingDataCoor},loadRecordingMetaSuccess: () => {- if (props.sessionRecordingId) {+ if (props.sessionRecordingId && !values.recordingTooLargeToPlay) {actions.loadSnapshotSources()}actions.reportUsageIfFullyLoaded()@@ -659,6 +674,26 @@ export const sessionRecordingDataCoordinatorLogic = kea<sessionRecordingDataCoor},})),selectors(() => ({+ recordingTooLargeToPlay: [+ (s) => [s.sessionPlayerMetaData, s.featureFlags],+ (meta: SessionRecordingType | null, featureFlags: FeatureFlagsSet): boolean => {+ if (!featureFlags[FEATURE_FLAGS.REPLAY_OVERSIZED_RECORDING_GATE]) {+ return false+ }+ // Mobile recordings are screenshot-based: large events, but cheap to play+ if (meta?.snapshot_source !== 'web') {+ return false+ }+ const totalSize = meta?.total_size ?? 0+ const eventCount = meta?.event_count ?? 0+ return (+ totalSize > OVERSIZED_RECORDING_AUTOLOAD_LIMIT_BYTES &&+ eventCount > 0 &&+ totalSize / eventCount > OVERSIZED_RECORDING_AVG_EVENT_BYTES+ )+ },+ ],+snapshots: [(s) => [s.processedSnapshots],(processedSnapshots: RecordingSnapshot[]): RecordingSnapshot[] => {diff --git a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.tsindex 1b006e2f9719..ce1825a91d02 100644--- a/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts+++ b/frontend/src/scenes/session-recordings/player/sessionRecordingPlayerLogic.ts@@ -541,6 +541,7 @@ export interface sessionRecordingPlayerLogicValues {createExportJSON: () => ExportedSessionRecordingFileV2 // sessionRecordingDataCoordinatorLogiccustomRRWebEvents: customEvent[] // sessionRecordingDataCoordinatorLogicfullyLoaded: boolean // sessionRecordingDataCoordinatorLogic+ recordingTooLargeToPlay: boolean // sessionRecordingDataCoordinatorLogicsessionPlayerData: SessionPlayerData // sessionRecordingDataCoordinatorLogicsessionPlayerMetaData: SessionRecordingType | null // sessionRecordingDataCoordinatorLogicsessionPlayerMetaDataLoading: boolean // sessionRecordingDataCoordinatorLogic@@ -1161,6 +1162,7 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>('customRRWebEvents','fullyLoaded','trackedWindow',+ 'recordingTooLargeToPlay',],playerSettingsLogic,['speed', 'skipInactivitySetting', 'showMetadataFooter', 'playerControlsOverlay'],@@ -2566,6 +2568,11 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(breakpoint()},loadRecordingMetaSuccess: () => {+ if (values.recordingTooLargeToPlay) {+ actions.setPlayerError('recordingTooLarge')+ return+ }+// As the connected data logic may be preloaded we call a shared function here and on mountactions.syncSnapshotsWithPlayer()diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 91fea820ac9a..79f4e965b7ab 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -2144,6 +2144,10 @@ export interface SessionRecordingType {external_references?: SessionRecordingExternalReference[]/** False when the recording was included in list results via a direct link despite not matching the filters. */matches_filters?: boolean+ /** Total stored size of the recording's snapshot data in bytes. Only present once metadata is loaded. */+ total_size?: number | null+ /** Number of captured rrweb events in the recording. Only present once metadata is loaded. */+ event_count?: number | null}export interface SessionRecordingUpdateType {diff --git a/posthog/schema.py b/posthog/schema.pyindex cb48cf0f0bdf..eca5ff557c37 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -6936,6 +6936,10 @@ class SessionRecordingType(BaseModel):distinct_id: str | None = Noneemail: str | None = Noneend_time: str = Field(..., description="When the recording ends in ISO format.")+ event_count: float | None = Field(+ default=None,+ description=("Number of captured rrweb events in the recording. Only present once metadata is loaded."),+ )expiry_time: str | None = Field(default=None, description="When the recording expires, in ISO format.")external_references: list[SessionRecordingExternalReference] | None = Field(default=None, description="External references to third party issues."@@ -6973,6 +6977,12 @@ class SessionRecordingType(BaseModel):start_time: str = Field(..., description="When the recording starts in ISO format.")start_url: str | None = Nonesummary: str | None = None+ total_size: float | None = Field(+ default=None,+ description=(+ "Total stored size of the recording's snapshot data in bytes. Only present once metadata is loaded."+ ),+ )viewed: bool = Field(..., description="Whether this recording has been viewed by you already.")viewers: list[str] = Field(..., description="user ids of other users who have viewed this recording")diff --git a/posthog/session_recordings/models/metadata.py b/posthog/session_recordings/models/metadata.pyindex 251e03741eee..3b723cc7b75c 100644--- a/posthog/session_recordings/models/metadata.py+++ b/posthog/session_recordings/models/metadata.py@@ -64,6 +64,8 @@ class RecordingMetadata(TypedDict):expiry_time: datetimerecording_ttl: intongoing: bool+ total_size: int+ event_count: intclass RecordingMatchingEvents(TypedDict):diff --git a/posthog/session_recordings/models/session_recording.py b/posthog/session_recordings/models/session_recording.pyindex c51989e7113a..cca60be4bd4d 100644--- a/posthog/session_recordings/models/session_recording.py+++ b/posthog/session_recordings/models/session_recording.py@@ -87,6 +87,8 @@ class SessionRecording(UUIDTModel):activity_score: Optional[float] = Noneexpiry_time: Optional[datetime] = Nonerecording_ttl: Optional[int] = None+ total_size: Optional[int] = None+ event_count: Optional[int] = None# False when this recording was included in listing results via session_recording_id# despite not matching the listing filtersmatches_filters: Optional[bool] = None@@ -139,6 +141,8 @@ class SessionRecording(UUIDTModel):self.expiry_time = metadata["expiry_time"]self.recording_ttl = metadata["recording_ttl"]self.ongoing = metadata["ongoing"]+ self.total_size = metadata["total_size"]+ self.event_count = metadata["event_count"]return Truediff --git a/posthog/session_recordings/queries/session_replay_events.py b/posthog/session_recordings/queries/session_replay_events.pyindex fe65cab89c7b..ecef5238332c 100644--- a/posthog/session_recordings/queries/session_replay_events.py+++ b/posthog/session_recordings/queries/session_replay_events.py@@ -444,7 +444,9 @@ class SessionReplayEvents:max(retention_period_days) as retention_period_days,dateTrunc('DAY', start_time) + toIntervalDay(coalesce(retention_period_days, 30)) as expiry_time,dateDiff('DAY', toDateTime(%(python_now)s), expiry_time) as recording_ttl,- max(_timestamp) >= toDateTime(%(python_now)s) - INTERVAL {ongoing_window_minutes} MINUTE as ongoing+ max(_timestamp) >= toDateTime(%(python_now)s) - INTERVAL {ongoing_window_minutes} MINUTE as ongoing,+ sum(size) as total_size,+ sum(event_count) as event_countFROMsession_replay_eventsPREWHERE@@ -497,6 +499,8 @@ class SessionReplayEvents:expiry_time=replay[19],recording_ttl=replay[20],ongoing=bool(replay[21]),+ total_size=replay[22],+ event_count=replay[23],)def get_metadata(@@ -586,7 +590,9 @@ class SessionReplayEvents:max(retention_period_days) as retention_period_days,dateTrunc('DAY', start_time) + toIntervalDay(coalesce(retention_period_days, 30)) as expiry_time,dateDiff('DAY', toDateTime(%(python_now)s), expiry_time) as recording_ttl,- max(_timestamp) >= toDateTime(%(python_now)s) - INTERVAL {ONGOING_SESSION_WINDOW_MINUTES} MINUTE as ongoing+ max(_timestamp) >= toDateTime(%(python_now)s) - INTERVAL {ONGOING_SESSION_WINDOW_MINUTES} MINUTE as ongoing,+ sum(size) as total_size,+ sum(event_count) as event_countFROMsession_replay_eventsPREWHEREdiff --git a/posthog/session_recordings/queries/test/test_session_replay_events.py b/posthog/session_recordings/queries/test/test_session_replay_events.pyindex 020d2273d420..fbd6375f8787 100644--- a/posthog/session_recordings/queries/test/test_session_replay_events.py+++ b/posthog/session_recordings/queries/test/test_session_replay_events.py@@ -97,6 +97,8 @@ class SessionReplayEventsQueries(ClickhouseTestMixin, APIBaseTest):"snapshot_source": "web","snapshot_library": None,"ongoing": True,+ "total_size": 0,+ "event_count": 0,}def test_get_metadata_with_block(self) -> None:@@ -123,6 +125,8 @@ class SessionReplayEventsQueries(ClickhouseTestMixin, APIBaseTest):"snapshot_source": "web","snapshot_library": None,"ongoing": True,+ "total_size": 0,+ "event_count": 0,}def test_get_metadata_with_multiple_blocks(self) -> None:@@ -155,6 +159,8 @@ class SessionReplayEventsQueries(ClickhouseTestMixin, APIBaseTest):"snapshot_source": "web","snapshot_library": None,"ongoing": True,+ "total_size": 0,+ "event_count": 0,}def test_get_nonexistent_metadata(self) -> None:@@ -202,6 +208,8 @@ class SessionReplayEventsQueries(ClickhouseTestMixin, APIBaseTest):"snapshot_source": "web","snapshot_library": None,"ongoing": True,+ "total_size": 0,+ "event_count": 0,}assert metadata_dict["2"] == {"active_seconds": 1.234,@@ -225,6 +233,8 @@ class SessionReplayEventsQueries(ClickhouseTestMixin, APIBaseTest):"snapshot_source": "web","snapshot_library": None,"ongoing": True,+ "total_size": 0,+ "event_count": 0,}def test_get_group_metadata_handles_nonexistent_sessions(self) -> None:diff --git a/posthog/session_recordings/session_recording_api.py b/posthog/session_recordings/session_recording_api.pyindex dbd4e3b36aea..68bc63f678c7 100644--- a/posthog/session_recordings/session_recording_api.py+++ b/posthog/session_recordings/session_recording_api.py@@ -293,6 +293,18 @@ class SessionRecordingSerializer(serializers.ModelSerializer, UserAccessControlS# Dynamic attrs set on the model instance — not Django fields, so declare explicitlyexpiry_time = serializers.DateTimeField(read_only=True, allow_null=True)recording_ttl = serializers.IntegerField(read_only=True, allow_null=True)+ total_size = serializers.IntegerField(+ read_only=True,+ allow_null=True,+ help_text="Total stored size of the recording's snapshot data in bytes. "+ "Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.",+ )+ event_count = serializers.IntegerField(+ read_only=True,+ allow_null=True,+ help_text="Number of captured rrweb events in the recording. "+ "Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.",+ )def get_ongoing(self, obj: SessionRecording) -> bool:# ongoing is a custom field that we add if loading from ClickHouse@@ -366,6 +378,8 @@ class SessionRecordingSerializer(serializers.ModelSerializer, UserAccessControlS"activity_score","external_references","matches_filters",+ "total_size",+ "event_count",]read_only_fields = [@@ -391,6 +405,8 @@ class SessionRecordingSerializer(serializers.ModelSerializer, UserAccessControlS"snapshot_library","ongoing","activity_score",+ "total_size",+ "event_count",]diff --git a/posthog/session_recordings/test/test_session_recordings.py b/posthog/session_recordings/test/test_session_recordings.pyindex 9a26841354e4..9a219192e27f 100644--- a/posthog/session_recordings/test/test_session_recordings.py+++ b/posthog/session_recordings/test/test_session_recordings.py@@ -448,6 +448,8 @@ class TestSessionRecordings(APIBaseTest, ClickhouseTestMixin, QueryMatchingTest)"activity_score": ANY,"external_references": [],"matches_filters": True,+ "total_size": None,+ "event_count": None,},]@@ -799,6 +801,8 @@ class TestSessionRecordings(APIBaseTest, ClickhouseTestMixin, QueryMatchingTest)"activity_score": None,"external_references": [],"matches_filters": True,+ "total_size": 0,+ "event_count": 0,}def test_single_session_recording_clamps_negative_inactive_seconds(self):diff --git a/products/replay/frontend/generated/api.schemas.ts b/products/replay/frontend/generated/api.schemas.tsindex 91805d9f4cd1..9e0e2228d42e 100644--- a/products/replay/frontend/generated/api.schemas.ts+++ b/products/replay/frontend/generated/api.schemas.ts@@ -233,6 +233,16 @@ export interface SessionRecordingApi {readonly external_references: readonly SessionRecordingApiExternalReferencesItem[]/** Whether this recording matched the filters of the listing query that returned it. False only when a recording requested via session_recording_id was included despite not matching the filters. */readonly matches_filters: boolean+ /**+ * Total stored size of the recording's snapshot data in bytes. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly total_size: number | null+ /**+ * Number of captured rrweb events in the recording. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly event_count: number | null}export interface PaginatedSessionRecordingListApi {@@ -293,6 +303,16 @@ export interface PatchedSessionRecordingApi {readonly external_references?: readonly PatchedSessionRecordingApiExternalReferencesItem[]/** Whether this recording matched the filters of the listing query that returned it. False only when a recording requested via session_recording_id was included despite not matching the filters. */readonly matches_filters?: boolean+ /**+ * Total stored size of the recording's snapshot data in bytes. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly total_size?: number | null+ /**+ * Number of captured rrweb events in the recording. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly event_count?: number | null}export interface SessionRecordingBulkDeleteRequestApi {diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 2055ec55bb39..25a63180addd 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -43789,6 +43789,8 @@ export namespace Schemas {email?: string | null;/** When the recording ends in ISO format. */end_time: string;+ /** Number of captured rrweb events in the recording. Only present once metadata is loaded. */+ event_count?: number | null;/** When the recording expires, in ISO format. */expiry_time?: string | null;/** External references to third party issues. */@@ -43818,6 +43820,8 @@ export namespace Schemas {start_time: string;start_url?: string | null;summary?: string | null;+ /** Total stored size of the recording's snapshot data in bytes. Only present once metadata is loaded. */+ total_size?: number | null;/** Whether this recording has been viewed by you already. */viewed: boolean;/** user ids of other users who have viewed this recording */@@ -55512,6 +55516,16 @@ export namespace Schemas {readonly external_references: readonly SessionRecordingExternalReferencesItem[];/** Whether this recording matched the filters of the listing query that returned it. False only when a recording requested via session_recording_id was included despite not matching the filters. */readonly matches_filters: boolean;+ /**+ * Total stored size of the recording's snapshot data in bytes. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly total_size: number | null;+ /**+ * Number of captured rrweb events in the recording. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly event_count: number | null;}export interface PaginatedSessionRecordingList {@@ -65033,6 +65047,16 @@ export namespace Schemas {readonly external_references?: readonly PatchedSessionRecordingExternalReferencesItem[];/** Whether this recording matched the filters of the listing query that returned it. False only when a recording requested via session_recording_id was included despite not matching the filters. */readonly matches_filters?: boolean;+ /**+ * Total stored size of the recording's snapshot data in bytes. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly total_size?: number | null;+ /**+ * Number of captured rrweb events in the recording. Only populated when the recording's metadata is loaded, e.g. on retrieve; null in list responses.+ * @nullable+ */+ readonly event_count?: number | null;}/**