From 26e531aca5178c9ed3d2ca8f48a59b9d7538e418 Mon Sep 17 00:00:00 2001 From: Paul D'Ambra Date: Mon, 9 Dec 2024 22:31:33 +0000 Subject: [PATCH] like the mobile SDKs --- .../replay/sessionrecording.test.ts | 42 ++++++++++++------- src/extensions/replay/sessionrecording.ts | 3 +- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/__tests__/extensions/replay/sessionrecording.test.ts b/src/__tests__/extensions/replay/sessionrecording.test.ts index f3dda12cb..a7be8f322 100644 --- a/src/__tests__/extensions/replay/sessionrecording.test.ts +++ b/src/__tests__/extensions/replay/sessionrecording.test.ts @@ -858,7 +858,8 @@ describe('SessionRecording', () => { ], $session_id: sessionId, $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _url: 'https://test.com/s/', @@ -894,7 +895,8 @@ describe('SessionRecording', () => { { type: 3, data: { source: 1 } }, { type: 3, data: { source: 2 } }, ], - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _url: 'https://test.com/s/', @@ -975,7 +977,8 @@ describe('SessionRecording', () => { $window_id: 'windowId', $snapshot_data: [{ data: { source: 1 }, emit: 1, type: 3 }], $snapshot_bytes: 39, - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _url: 'https://test.com/s/', @@ -1583,7 +1586,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _batchKey: 'recordings', @@ -1674,7 +1678,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _batchKey: 'recordings', @@ -1701,7 +1706,8 @@ describe('SessionRecording', () => { $session_id: firstSessionId, $snapshot_bytes: 186, $window_id: expect.any(String), - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, { _batchKey: 'recordings', @@ -2122,7 +2128,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2144,7 +2151,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2174,7 +2182,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2205,7 +2214,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: expect.any(Number), $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2225,7 +2235,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 86, $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2250,7 +2261,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 58, $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2274,7 +2286,8 @@ describe('SessionRecording', () => { $session_id: sessionId, $snapshot_bytes: 69, $window_id: 'windowId', - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, captureOptions ) @@ -2321,7 +2334,8 @@ describe('SessionRecording', () => { { type: 3, data: { source: 1 } }, { type: 3, data: { source: 2 } }, ], - $snapshot_library: 'web/ver/v0.0.1/script_name/recorder', + $lib: 'web', + $lib_version: 'v0.0.1', }, expect.any(Object) ) diff --git a/src/extensions/replay/sessionrecording.ts b/src/extensions/replay/sessionrecording.ts index fba1e060a..36d95dad7 100644 --- a/src/extensions/replay/sessionrecording.ts +++ b/src/extensions/replay/sessionrecording.ts @@ -1186,7 +1186,8 @@ export class SessionRecording { $snapshot_data: snapshotBuffer.data, $session_id: snapshotBuffer.sessionId, $window_id: snapshotBuffer.windowId, - $snapshot_library: `web/ver/${Config.LIB_VERSION}/script_name/${this.scriptName}`, + $lib: 'web', + $lib_version: Config.LIB_VERSION, }) }) }