diff --git a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx index c51e9e4473514..ec96e27fbcfd4 100644 --- a/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx +++ b/frontend/src/lib/components/CommandPalette/commandPaletteLogic.tsx @@ -574,17 +574,8 @@ export const commandPaletteLogic = kea({ icon: IconRecording, display: 'Debug: Copy the session recording link to clipboard', executor: () => { - const LOOK_BACK = 30 - const recordingStartTime = Math.max( - Math.floor( - (new Date().getTime() - (posthog?.sessionManager?._sessionStartTimestamp || 0)) / 1000 - ) - LOOK_BACK, - 0 - ) - void copyToClipboard( - `${window.location.origin}/recordings/${posthog?.sessionRecording?.sessionId}?t=${recordingStartTime}`, - 'Current session recording link to clipboard' - ) + const url = posthog.get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 }) + void copyToClipboard(url, 'Current session recording link to clipboard') }, }, } diff --git a/frontend/src/lib/components/Support/supportLogic.ts b/frontend/src/lib/components/Support/supportLogic.ts index 7fb67f3de3bd5..297305cd5fd74 100644 --- a/frontend/src/lib/components/Support/supportLogic.ts +++ b/frontend/src/lib/components/Support/supportLogic.ts @@ -13,12 +13,10 @@ import { preflightLogic } from 'scenes/PreflightCheck/preflightLogic' import { teamLogic } from 'scenes/teamLogic' function getSessionReplayLink(): string { - const LOOK_BACK = 30 - const recordingStartTime = Math.max( - Math.floor((new Date().getTime() - (posthog?.sessionManager?._sessionStartTimestamp || 0)) / 1000) - LOOK_BACK, - 0 - ) - const link = `http://go/session/${posthog?.sessionRecording?.sessionId}?t=${recordingStartTime}` + const link = posthog + .get_session_replay_url({ withTimestamp: true, timestampLookBack: 30 }) + .replace(window.location.origin + '/replay/', 'http://go/session/') + return `Session: ${link} (at ${window.location.href.replace(/&supportModal=.+($|&)?/, '$1')})` } diff --git a/package.json b/package.json index fe6e974870558..2d846ecf4ce39 100644 --- a/package.json +++ b/package.json @@ -121,7 +121,7 @@ "kea-window-values": "^3.0.0", "md5": "^2.3.0", "monaco-editor": "^0.39.0", - "posthog-js": "1.67.1", + "posthog-js": "1.68.2", "posthog-js-lite": "2.0.0-alpha5", "prettier": "^2.8.8", "prop-types": "^15.7.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 46ce29a834744..953b3867c303c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -183,8 +183,8 @@ dependencies: specifier: ^0.39.0 version: 0.39.0 posthog-js: - specifier: 1.67.1 - version: 1.67.1 + specifier: 1.68.2 + version: 1.68.2 posthog-js-lite: specifier: 2.0.0-alpha5 version: 2.0.0-alpha5 @@ -13331,7 +13331,7 @@ packages: dependencies: universalify: 2.0.0 optionalDependencies: - graceful-fs: 4.2.11 + graceful-fs: 4.2.10 /jsprim@2.0.2: resolution: {integrity: sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==} @@ -15622,8 +15622,8 @@ packages: resolution: {integrity: sha512-tlkBdypJuvK/s00n4EiQjwYVfuuZv6vt8BF3g1ooIQa2Gz9Vz80p8q3qsPLZ0V5ErGRy6i3Q4fWC9TDzR7GNRQ==} dev: false - /posthog-js@1.67.1: - resolution: {integrity: sha512-gvdCVrrxoRYbtNTCUt2/YdZ+tfSfzcl72ym/dtRVCYJpwlCUIKnNJ3E2g7Bbw1+Ki6CvGxdu9r7jHIWnvJAMuw==} + /posthog-js@1.68.2: + resolution: {integrity: sha512-oh3MQonhbgVbBYNJ/cAx1L6fginAF5Msz3shexnXPhDNKj1DQGosepQC6TQpdeeUWp0H7R2cQG9eHJwmrEM1Lw==} dependencies: fflate: 0.4.8 dev: false