File tree Expand file tree Collapse file tree 4 files changed +22
-15
lines changed
views/Generator/AutoCorrelation Expand file tree Collapse file tree 4 files changed +22
-15
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ export function initialize() {
9292
9393 ipcMain . handle (
9494 ScriptHandler . RunFromGenerator ,
95- async ( event , script : string ) => {
95+ async ( event , script : string , shouldTrack = true ) => {
9696 console . info ( `${ ScriptHandler . RunFromGenerator } event received` )
9797 await writeFile ( TEMP_GENERATOR_SCRIPT_PATH , script )
9898
@@ -105,12 +105,14 @@ export function initialize() {
105105 usageReport : k6StudioState . appSettings . telemetry . usageReport ,
106106 } )
107107
108- trackEvent ( {
109- event : UsageEventName . ScriptValidated ,
110- payload : {
111- isExternal : false ,
112- } ,
113- } )
108+ if ( shouldTrack ) {
109+ trackEvent ( {
110+ event : UsageEventName . ScriptValidated ,
111+ payload : {
112+ isExternal : false ,
113+ } ,
114+ } )
115+ }
114116
115117 await unlink ( TEMP_GENERATOR_SCRIPT_PATH )
116118 }
Original file line number Diff line number Diff line change @@ -17,10 +17,11 @@ export function openScript(scriptPath: string) {
1717 ) as Promise < OpenScriptResult >
1818}
1919
20- export function runScriptFromGenerator ( script : string ) {
20+ export function runScriptFromGenerator ( script : string , shouldTrack = true ) {
2121 return ipcRenderer . invoke (
2222 ScriptHandler . RunFromGenerator ,
23- script
23+ script ,
24+ shouldTrack
2425 ) as Promise < void >
2526}
2627
Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import { processProxyData } from './proxyData'
77 */
88export async function validateScript (
99 script : string ,
10- signal ?: AbortSignal
10+ signal ?: AbortSignal ,
11+ shouldTrack = true
1112) : Promise < ProxyData [ ] > {
1213 let collectedData : ProxyData [ ] = [ ]
1314
@@ -51,9 +52,11 @@ export async function validateScript(
5152 } )
5253
5354 // Run the script
54- window . studio . script . runScriptFromGenerator ( script ) . catch ( ( error ) => {
55- cleanup ( )
56- reject ( error )
57- } )
55+ window . studio . script
56+ . runScriptFromGenerator ( script , shouldTrack )
57+ . catch ( ( error ) => {
58+ cleanup ( )
59+ reject ( error )
60+ } )
5861 } )
5962}
Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ export const useGenerateRules = ({
165165
166166 const validationResult = await validateScript (
167167 script ,
168- abortControllerRef . current ?. signal
168+ abortControllerRef . current ?. signal ,
169+ false
169170 )
170171
171172 const result = validationMatchesRecording (
You can’t perform that action at this time.
0 commit comments