Skip to content

Commit

Permalink
fix: invalid state detection (#18555)
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra authored Nov 10, 2023
1 parent dd9bb27 commit 4992e7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
})
}

return everyWindowMissingFullSnapshot || anyWindowMissingFullSnapshot
return everyWindowMissingFullSnapshot
},
],

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic'
import { featureFlagLogic } from 'lib/logic/featureFlagLogic'
import { FEATURE_FLAGS } from 'lib/constants'
import type { sessionRecordingsPlaylistLogicType } from '../playlist/sessionRecordingsPlaylistLogicType'
import { subscriptions } from 'kea-subscriptions'

export const PLAYBACK_SPEEDS = [0.5, 1, 2, 3, 4, 8, 16]
export const ONE_FRAME_MS = 100 // We don't really have frames but this feels granular enough
Expand Down Expand Up @@ -331,6 +332,13 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(
},
],
})),
subscriptions(({ actions }) => ({
snapshotsInvalid: (value) => {
if (value) {
actions.setErrorPlayerState(true)
}
},
})),
selectors({
// Prop references for use by other logics
sessionRecordingId: [() => [(_, props) => props], (props): string => props.sessionRecordingId],
Expand All @@ -346,7 +354,6 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(
s.isSkippingInactivity,
s.snapshotsLoaded,
s.sessionPlayerSnapshotDataLoading,
s.snapshotsInvalid,
],
(
playingState,
Expand All @@ -355,13 +362,8 @@ export const sessionRecordingPlayerLogic = kea<sessionRecordingPlayerLogicType>(
isScrubbing,
isSkippingInactivity,
snapshotsLoaded,
snapshotsLoading,
snapshotsInvalid
snapshotsLoading
) => {
if (snapshotsInvalid) {
return SessionPlayerState.ERROR
}

if (isScrubbing) {
// If scrubbing, playingState takes precedence
return playingState
Expand Down

0 comments on commit 4992e7d

Please sign in to comment.