Skip to content

Commit

Permalink
fix: Recording event loading (#12297)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Kim <[email protected]>
  • Loading branch information
benjackwhite and alexkim205 authored Oct 17, 2022
1 parent 7aaa6ef commit 9f0602a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function PlayerList<T extends Record<string, any>>({

return (
<div className="PlayerList">
{sessionEventsDataLoading || sessionPlayerMetaDataLoading ? (
{!data.length && (sessionEventsDataLoading || sessionPlayerMetaDataLoading) ? (
<SpinnerOverlay />
) : (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const eventsListLogic = kea<eventsListLogicType>([
logic: [eventUsageLogic],
actions: [
sessionRecordingDataLogic({ sessionRecordingId }),
['setFilters', 'loadEventsSuccess'],
['setFilters'],
sessionRecordingPlayerLogic({ sessionRecordingId, playerKey }),
['seek'],
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,6 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
loadRecordingSnapshotsSuccess: (state) => state + 1,
},
],
sessionEventsDataLoading: [
false,
{
loadEventsSuccess: (_, { sessionEventsData }) => {
return !!sessionEventsData?.next
},
},
],
loadMetaTimeMs: [
null as number | null,
{
Expand Down Expand Up @@ -236,14 +228,14 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
else {
eventUsageLogic.actions.reportRecording(
values.sessionPlayerData,
performance.now() - cache.startTime,
performance.now() - cache.loadStartTime,
SessionRecordingUsageType.LOADED,
0
)
}
// Not always accurate that recording is playable after first chunk is loaded, but good guesstimate for now
if (values.chunkPaginationIndex === 1) {
actions.reportUsage(values.sessionPlayerData, performance.now() - cache.startTime)
actions.reportUsage(values.sessionPlayerData, performance.now() - cache.loadStartTime)
}
},
loadEventsSuccess: () => {
Expand Down

0 comments on commit 9f0602a

Please sign in to comment.