@@ -28,7 +28,7 @@ export class SocketTransport {
2828 private hasConnectedOnce : boolean = false
2929
3030 private readonly retryConfig : RetryConfig = {
31- maxInitialAttempts : 10 ,
31+ maxInitialAttempts : Infinity ,
3232 initialDelay : 1_000 ,
3333 maxDelay : 15_000 ,
3434 backoffMultiplier : 2 ,
@@ -67,12 +67,8 @@ export class SocketTransport {
6767 await this . connectWithRetry ( )
6868 } catch ( error ) {
6969 console . error (
70- `[SocketTransport] Initial connection attempts failed : ${ error instanceof Error ? error . message : String ( error ) } ` ,
70+ `[SocketTransport] Unexpected error in connection loop : ${ error instanceof Error ? error . message : String ( error ) } ` ,
7171 )
72-
73- // If we've never connected successfully, we've exhausted our retry attempts
74- // The user will need to manually retry or fix the issue
75- this . connectionState = ConnectionState . FAILED
7672 }
7773 }
7874
@@ -83,9 +79,7 @@ export class SocketTransport {
8379 try {
8480 this . connectionState = this . retryAttempt === 0 ? ConnectionState . CONNECTING : ConnectionState . RETRYING
8581
86- console . log (
87- `[SocketTransport] Connection attempt ${ this . retryAttempt + 1 } / ${ this . retryConfig . maxInitialAttempts } ` ,
88- )
82+ console . log ( `[SocketTransport] Connection attempt ${ this . retryAttempt + 1 } ` )
8983
9084 await this . connectSocket ( )
9185
@@ -111,12 +105,6 @@ export class SocketTransport {
111105 this . socket = null
112106 }
113107
114- if ( this . retryAttempt >= this . retryConfig . maxInitialAttempts ) {
115- this . connectionState = ConnectionState . FAILED
116-
117- throw new Error ( `Failed to connect after ${ this . retryConfig . maxInitialAttempts } attempts` )
118- }
119-
120108 console . log ( `[SocketTransport] Waiting ${ delay } ms before retry...` )
121109
122110 await this . delay ( delay )
@@ -204,10 +192,7 @@ export class SocketTransport {
204192 this . socket . on ( "reconnect_failed" , ( ) => {
205193 console . error ( `[SocketTransport] Socket.IO reconnection failed after all attempts` )
206194
207- this . connectionState = ConnectionState . FAILED
208-
209- // Socket.IO has exhausted its reconnection attempts
210- // The connection is now permanently failed until manual intervention
195+ this . connectionState = ConnectionState . RETRYING
211196 } )
212197
213198 this . socket . on ( "error" , ( error ) => {
0 commit comments