@@ -11,8 +11,9 @@ import {
11
11
debugStreamEventReceived ,
12
12
infoStreamStopped ,
13
13
warnStreamDisconnectedWithRetry ,
14
- resetDisconnectCounter , restartDisconnectCounter
15
- } from "./sdk_codes" ;
14
+ resetDisconnectCounter ,
15
+ restartDisconnectCounter ,
16
+ } from './sdk_codes' ;
16
17
17
18
type FetchFunction = (
18
19
identifier : string ,
@@ -188,8 +189,8 @@ export class StreamProcessor {
188
189
. on ( 'timeout' , ( ) => {
189
190
onFailed (
190
191
'SSE request timed out after ' +
191
- StreamProcessor . SSE_TIMEOUT_MS +
192
- 'ms' ,
192
+ StreamProcessor . SSE_TIMEOUT_MS +
193
+ 'ms' ,
193
194
) ;
194
195
} )
195
196
. setTimeout ( StreamProcessor . SSE_TIMEOUT_MS ) ;
@@ -217,13 +218,25 @@ export class StreamProcessor {
217
218
this . api . getFeatureConfigByIdentifier . bind ( this . api ) ,
218
219
this . repository . setFlag . bind ( this . repository ) ,
219
220
this . repository . deleteFlag . bind ( this . repository ) ,
221
+ ) . then (
222
+ ( _ ) => this . log . info ( '>>SSE Got flag for:' , msg . identifier ) ,
223
+ ( e ) =>
224
+ this . log . error ( '>>SSE Failed to get flag for:' , msg . identifier , e ) ,
220
225
) ;
221
226
} else if ( msg . domain === 'target-segment' ) {
222
227
this . msgProcessor (
223
228
msg ,
224
229
this . api . getSegmentByIdentifier . bind ( this . api ) ,
225
230
this . repository . setSegment . bind ( this . repository ) ,
226
231
this . repository . deleteSegment . bind ( this . repository ) ,
232
+ ) . then (
233
+ ( _ ) => this . log . info ( 'SSE Got target-segment for:' , msg . identifier ) ,
234
+ ( e ) =>
235
+ this . log . error (
236
+ '>>SSE Failed to get target-segment for:' ,
237
+ msg . identifier ,
238
+ e ,
239
+ ) ,
227
240
) ;
228
241
}
229
242
}
@@ -275,7 +288,7 @@ export class StreamProcessor {
275
288
this . readyState = StreamProcessor . CLOSED ;
276
289
this . log . info ( 'Closing StreamProcessor' ) ;
277
290
278
- resetDisconnectCounter ( )
291
+ resetDisconnectCounter ( ) ;
279
292
this . request . destroy ( ) ;
280
293
this . request = undefined ;
281
294
0 commit comments