@@ -35,8 +35,8 @@ export const flowRunsApi = {
35
35
onUpdate : ( response : FlowRun ) => void ,
36
36
) : Promise < void > {
37
37
socket . emit ( WebsocketServerEvent . TEST_FLOW_RUN , request ) ;
38
- const initalRun = await getInitialRun ( socket , request . flowVersionId ) ;
39
- onUpdate ( initalRun ) ;
38
+ const initialRun = await getInitialRun ( socket , request . flowVersionId ) ;
39
+ onUpdate ( initialRun ) ;
40
40
} ,
41
41
addRunListener (
42
42
socket : Socket ,
@@ -51,14 +51,17 @@ export const flowRunsApi = {
51
51
if ( isFlowStateTerminal ( response . status ) ) {
52
52
socket . off ( WebsocketClientEvent . FLOW_RUN_PROGRESS , handleProgress ) ;
53
53
socket . off ( 'error' , handleError ) ;
54
+ console . log ( 'clear FLOW_RUN_PROGRESS listener' + response . id ) ;
54
55
}
55
56
} ;
56
57
const handleError = ( error : any ) => {
57
58
socket . off ( WebsocketClientEvent . FLOW_RUN_PROGRESS , handleProgress ) ;
58
59
socket . off ( 'error' , handleError ) ;
60
+ console . log ( 'clear FLOW_RUN_PROGRESS listener' , error ) ;
59
61
} ;
60
62
61
63
socket . on ( WebsocketClientEvent . FLOW_RUN_PROGRESS , handleProgress ) ;
64
+ console . log ( 'listened to FLOW_RUN_PROGRESS' ) ;
62
65
socket . on ( 'error' , handleError ) ;
63
66
} ,
64
67
testStep (
@@ -79,17 +82,20 @@ export const flowRunsApi = {
79
82
handleStepFinished ,
80
83
) ;
81
84
socket . off ( 'error' , handleError ) ;
85
+ console . log ( 'clear TEST_STEP_FINISHED listener' + response . id ) ;
86
+
82
87
resolve ( response ) ;
83
88
}
84
89
} ;
85
90
86
91
const handleError = ( error : any ) => {
87
92
socket . off ( WebsocketClientEvent . TEST_STEP_FINISHED , handleStepFinished ) ;
88
93
socket . off ( 'error' , handleError ) ;
94
+ console . log ( 'clear TEST_STEP_FINISHED listener' , error ) ;
89
95
reject ( error ) ;
90
96
} ;
91
-
92
97
socket . on ( WebsocketClientEvent . TEST_STEP_FINISHED , handleStepFinished ) ;
98
+ console . log ( 'listened to TEST_STEP_FINISHED' ) ;
93
99
socket . on ( 'error' , handleError ) ;
94
100
} ) ;
95
101
} ,
@@ -103,10 +109,13 @@ function getInitialRun(
103
109
if ( run . flowVersionId !== flowVersionId ) {
104
110
return ;
105
111
}
112
+
106
113
socket . off ( WebsocketClientEvent . TEST_FLOW_RUN_STARTED , onRunStarted ) ;
114
+ console . log ( 'clear TEST_FLOW_RUN_STARTED listener' + run . id ) ;
107
115
resolve ( run ) ;
108
116
} ;
109
117
110
118
socket . on ( WebsocketClientEvent . TEST_FLOW_RUN_STARTED , onRunStarted ) ;
119
+ console . log ( 'listened to TEST_FLOW_RUN_STARTED' ) ;
111
120
} ) ;
112
121
}
0 commit comments