Skip to content

Commit

Permalink
chore: remove artificial lag (#23039)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Jun 18, 2024
1 parent f5dcb19 commit 44a8c5e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 0 additions & 1 deletion frontend/src/lib/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ export const FEATURE_FLAGS = {
PLUGINS_FILTERING: 'plugins-filtering', // owner: @benjackwhite
SESSION_REPLAY_HOG_QL_FILTERING: 'session-replay-hogql-filtering', // owner: #team-replay
INSIGHT_LOADING_BAR: 'insight-loading-bar', // owner: @aspicer
SESSION_REPLAY_ARTIFICIAL_LAG: 'artificial-lag-query-performance', // owner: #team-replay
PROXY_AS_A_SERVICE: 'proxy-as-a-service', // owner: #team-infrastructure
LIVE_EVENTS: 'live-events', // owner: @zach or @jams
SESSION_REPLAY_NETWORK_VIEW: 'session-replay-network-view', // owner: #team-replay
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { UniversalFiltersGroup, UniversalFilterValue } from 'lib/components/Univ
import { DEFAULT_UNIVERSAL_GROUP_FILTER } from 'lib/components/UniversalFilters/universalFiltersLogic'
import { isActionFilter, isEventFilter } from 'lib/components/UniversalFilters/utils'
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'
Expand Down Expand Up @@ -284,14 +283,6 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
hog_ql_filtering: values.useHogQLFiltering,
}

if (values.artificialLag && !params.date_to) {
// values.artificalLag is a number of seconds to delay the recordings by
// convert it to an absolute UTC timestamp as the relative date parsing in the backend
// can't cope with seconds as a relative date
const absoluteLag = now().subtract(values.artificialLag, 'second')
params['date_to'] = absoluteLag.toISOString()
}

if (values.orderBy === 'start_time') {
if (direction === 'older') {
params['date_to'] =
Expand Down Expand Up @@ -353,7 +344,7 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic

recordings = [...recordings, ...fetchedRecordings.results]
}
// TODO: Check for pinnedRecordings being IDs and fetch them, returnig the merged list
// TODO: Check for pinnedRecordings being IDs and fetch them, returning the merged list

return recordings
},
Expand Down Expand Up @@ -578,16 +569,6 @@ export const sessionRecordingsPlaylistLogic = kea<sessionRecordingsPlaylistLogic
},
})),
selectors({
artificialLag: [
(s) => [s.featureFlags],
(featureFlags) => {
const lag = featureFlags[FEATURE_FLAGS.SESSION_REPLAY_ARTIFICIAL_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: [
(s) => [s.featureFlags],
(featureFlags) => !!featureFlags[FEATURE_FLAGS.SESSION_REPLAY_HOG_QL_FILTERING],
Expand Down

0 comments on commit 44a8c5e

Please sign in to comment.