0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00

chore: flag clickhouse fallback (#17321)

* chore: flag clickhouse fallback

* make this opt in instead of opt out

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

* Update UI snapshots for `chromium` (2)

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Paul D'Ambra 2023-09-06 14:39:03 +01:00 committed by GitHub
parent b9f0039e9c
commit 6bd245ddf6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

View File

@ -161,6 +161,8 @@ export const FEATURE_FLAGS = {
PRODUCT_SPECIFIC_ONBOARDING: 'product-specific-onboarding', // owner: @raquelmsmith
REDIRECT_SIGNUPS_TO_INSTANCE: 'redirect-signups-to-instance', // owner: @raquelmsmith
APPS_AND_EXPORTS_UI: 'apps-and-exports-ui', // owner: @benjackwhite
// owner: #team-monitoring
SESSION_RECORDING_ALLOW_V1_SNAPSHOTS: 'session-recording-allow-v1-snapshots',
} as const
export type FeatureFlagKey = (typeof FEATURE_FLAGS)[keyof typeof FEATURE_FLAGS]

View File

@ -219,13 +219,17 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
loadRecordingSnapshotsV2Success: () => {
const { snapshots, sources } = values.sessionPlayerSnapshotData ?? {}
if (snapshots && !snapshots.length && sources?.length === 1) {
const canFallbackToClickHouse = values.canFallbackToClickHouseForData
// We got the snapshot response for realtime, and it was empty, so we fall back to the old API
// Until we migrate over we need to fall back to the old API if the new one returns no snapshots
posthog.capture('recording_snapshots_v2_empty_response', {
source: sources[0],
canFallbackToClickHouse,
})
actions.loadRecordingSnapshotsV1()
if (canFallbackToClickHouse) {
actions.loadRecordingSnapshotsV1()
}
return
}
@ -563,6 +567,12 @@ export const sessionRecordingDataLogic = kea<sessionRecordingDataLogicType>([
],
})),
selectors({
canFallbackToClickHouseForData: [
(s) => [s.featureFlags],
(featureFlags) => {
return featureFlags[FEATURE_FLAGS.SESSION_RECORDING_ALLOW_V1_SNAPSHOTS]
},
],
sessionPlayerData: [
(s) => [
s.sessionPlayerMetaData,