diff --git a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts index 5f94becf2c1af..e6a851f8f2e99 100644 --- a/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts +++ b/frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts @@ -5,6 +5,7 @@ import { actionToUrl, router, urlToAction } from 'kea-router' import { subscriptions } from 'kea-subscriptions' import api from 'lib/api' import { FEATURE_FLAGS } from 'lib/constants' +import { now } from 'lib/dayjs' import { featureFlagLogic } from 'lib/logic/featureFlagLogic' import { objectClean, objectsEqual } from 'lib/utils' import { eventUsageLogic } from 'lib/utils/eventUsageLogic' @@ -220,7 +221,11 @@ export const sessionRecordingsPlaylistLogic = kea [s.featureFlags], - (featureFlags): string | null => { + (featureFlags) => { const lag = featureFlags[FEATURE_FLAGS.SESSION_REPLAY_ARTIFICIAL_LAG] - // you can't edit variants right now, and I didn't put minus on the variant name 🤷 - return lag === undefined || lag === 'control' ? null : '-' + lag + // lag needs to match `\d+` when present it is a number of seconds delay + // relative_date parsing in the backend can't cope with seconds + // so it will be converted to an absolute date when added to API call + return typeof lag === 'string' && /^\d+$/.test(lag) ? Number.parseInt(lag) : null }, ], useHogQLFiltering: [