Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: invalid state detection #18555

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading