@@ -52,19 +52,15 @@ class SSEService {
5252 * Will automatically reconnect on disconnection.
5353 */
5454 connect ( ) : void {
55- console . log ( 'SSE: connect() called' ) ;
5655 if ( this . abortController || this . isConnecting ) {
57- console . log ( 'SSE: Already connected or connecting, skipping' ) ;
5856 return ;
5957 }
6058
6159 const token = getToken ( ) ;
6260 if ( ! token ) {
63- console . warn ( 'SSE: No auth token, skipping connection' ) ;
6461 return ;
6562 }
6663
67- console . log ( 'SSE: Initiating connection...' ) ;
6864 this . isConnecting = true ;
6965
7066 // For SSE, we need to bypass the webpack-dev-server proxy which buffers responses.
@@ -91,7 +87,6 @@ class SSEService {
9187 // Create abort controller for this connection
9288 this . abortController = new AbortController ( ) ;
9389
94- console . log ( `SSE: Fetching ${ baseUrl } /events/stream` ) ;
9590 const response = await fetch ( `${ baseUrl } /events/stream` , {
9691 method : 'GET' ,
9792 headers : {
@@ -101,7 +96,6 @@ class SSEService {
10196 signal : this . abortController . signal ,
10297 } ) ;
10398
104- console . log ( `SSE: Response status ${ response . status } ` ) ;
10599 if ( ! response . ok ) {
106100 throw new Error ( `SSE connection failed: ${ response . status } ` ) ;
107101 }
@@ -114,8 +108,6 @@ class SSEService {
114108 this . reconnectAttempts = 0 ;
115109 this . reconnectDelay = 1000 ;
116110
117- console . log ( 'SSE: Connected' ) ;
118-
119111 const reader = response . body . getReader ( ) ;
120112 const decoder = new TextDecoder ( ) ;
121113 let buffer = '' ;
@@ -127,7 +119,6 @@ class SSEService {
127119 const { done, value } = await reader . read ( ) ;
128120
129121 if ( done ) {
130- console . log ( 'SSE: Stream ended' ) ;
131122 this . handleDisconnect ( ) ;
132123 return ;
133124 }
@@ -156,15 +147,13 @@ class SSEService {
156147 }
157148 }
158149 }
159- } catch ( error ) {
160- console . error ( 'SSE: Stream error' , error ) ;
150+ } catch ( _error ) {
161151 this . handleDisconnect ( ) ;
162152 }
163153 } ;
164154
165155 processStream ( ) ;
166- } catch ( error ) {
167- console . error ( 'SSE: Connection error' , error ) ;
156+ } catch ( _error ) {
168157 this . isConnecting = false ;
169158 this . handleDisconnect ( ) ;
170159 }
@@ -192,11 +181,11 @@ class SSEService {
192181 eventHub . emit ( 'sseTaskColumnUpdated' , data ) ;
193182 break ;
194183 case 'connected' :
195- console . log ( 'SSE: Server acknowledged connection' ) ;
184+ // Server acknowledged connection
196185 break ;
197186 }
198- } catch ( error ) {
199- console . error ( 'SSE: Failed to parse event data' , error , dataStr ) ;
187+ } catch ( _error ) {
188+ // Failed to parse event data
200189 }
201190 }
202191
@@ -207,16 +196,13 @@ class SSEService {
207196 if ( this . reconnectAttempts < this . maxReconnectAttempts ) {
208197 this . reconnectAttempts ++ ;
209198 const delay = this . reconnectDelay * 2 ** ( this . reconnectAttempts - 1 ) ;
210- console . log ( `SSE: Reconnecting in ${ delay } ms (attempt ${ this . reconnectAttempts } )` ) ;
211199
212200 setTimeout ( ( ) => {
213201 const token = getToken ( ) ;
214202 if ( token ) {
215203 this . connect ( ) ;
216204 }
217205 } , delay ) ;
218- } else {
219- console . warn ( 'SSE: Max reconnect attempts reached' ) ;
220206 }
221207 }
222208
@@ -229,7 +215,6 @@ class SSEService {
229215 this . abortController = null ;
230216 }
231217 this . reconnectAttempts = this . maxReconnectAttempts ; // Prevent auto-reconnect
232- console . log ( 'SSE: Disconnected' ) ;
233218 }
234219
235220 /**
0 commit comments