Created
August 8, 2023 14:35
-
-
Save jasonLaster/108790478a2613a7e4062f4c9e1caa75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/processing/replayRecording.ts b/src/processing/replayRecording.ts | |
index 64e6e5570..edac9048f 100644 | |
--- a/src/processing/replayRecording.ts | |
+++ b/src/processing/replayRecording.ts | |
@@ -158,6 +158,20 @@ interface PauseInfo extends TimeStampedPoint { | |
pauseId: string; | |
} | |
+type RecordingMetadata = { | |
+ workspace: { | |
+ name: string; | |
+ id: string; | |
+ } | void; | |
+ url: string; | |
+ buildId: string; | |
+ date: string; | |
+ user: { | |
+ id: string; | |
+ email: string; | |
+ } | void; | |
+}; | |
+ | |
export class Fuzzer { | |
dispatchAddress: string; | |
recordingId: string; | |
@@ -165,11 +179,16 @@ export class Fuzzer { | |
sessionId: string | undefined; | |
client: RecordingClient | undefined; | |
buildId: string | undefined; | |
+ recordingMetadata: RecordingMetadata; | |
- constructor(dispatchAddress: string, recordingId: string, url?: string) { | |
+ constructor( | |
+ dispatchAddress: string, | |
+ recordingId: string, | |
+ recordingMetadata: RecordingMetadata | |
+ ) { | |
this.dispatchAddress = dispatchAddress; | |
this.recordingId = recordingId; | |
- this.url = url; | |
+ this.recordingMetadata = recordingMetadata; | |
} | |
async destroy() { | |
@@ -286,10 +305,7 @@ export class Fuzzer { | |
pingTelemetry(event, { | |
recordingId: this.recordingId, | |
buildId: this.buildId, | |
- recording: { | |
- id: this.recordingId, | |
- buildId: this.buildId, | |
- }, | |
+ recording: this.recordingMetadata, | |
sessionId: this.sessionId, | |
...tags, | |
service_name: "testinbox", | |
@@ -899,13 +915,13 @@ export type ReplayOptions = { | |
export async function replayRecording( | |
dispatchAddress: string, | |
recordingId: string, | |
- url?: string, | |
options: ReplayOptions = {}, | |
+ recordingMetadata: RecordingMetadata, | |
experimentalSettings?: Partial<UserExperimentalSettings> | |
): Promise<boolean> { | |
log("Replay recording", recordingId); | |
let sessionId: string | null = null; | |
- const fuzzer = new Fuzzer(dispatchAddress, recordingId, url); | |
+ const fuzzer = new Fuzzer(dispatchAddress, recordingId, recordingMetadata); | |
const startTime = new Date(); | |
let success = false; | |
@@ -1066,9 +1082,9 @@ export async function replayRecording( | |
export async function replayRecordingWithTimeout( | |
dispatchAddress: string, | |
recordingId: string, | |
- url: string | undefined, | |
options: ReplayOptions, | |
timeoutSeconds: number, | |
+ recordingMetadata: RecordingMetadata, | |
experimentalSettings?: Partial<UserExperimentalSettings> | |
): Promise<boolean> { | |
let success = false; | |
@@ -1076,8 +1092,8 @@ export async function replayRecordingWithTimeout( | |
replayRecording( | |
dispatchAddress, | |
recordingId, | |
- url, | |
options, | |
+ recordingMetadata, | |
experimentalSettings | |
).then(rv => { | |
success = rv; | |
@@ -1127,7 +1143,7 @@ if (process.argv[1].includes("replayRecording")) { | |
assert(recordingId, "No recording specified"); | |
- replayRecording(server, recordingId, url, options).catch(() => { | |
+ replayRecording(server, recordingId, options, {}).catch(() => { | |
console.error("Fuzzing failed"); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment