File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -351,6 +351,8 @@ export class SocketIOProvider extends Observable {
351
351
* @readonly
352
352
*/
353
353
onSocketDisconnection = ( event ) => {
354
+ if ( event === 'io server disconnect' ) this . socket . connect ( )
355
+
354
356
this . emit ( 'connection-close' , [ event , this ] )
355
357
this . synced = false
356
358
AwarenessProtocol . removeAwarenessStates (
Original file line number Diff line number Diff line change @@ -211,7 +211,11 @@ export class YSocketIO {
211
211
const namespace = this . getNamespaceString ( socket . nsp )
212
212
if ( toobusy ( ) ) {
213
213
logSocketIO ( `warning server too busy, rejecting connection: ${ namespace } ` )
214
- throw new Error ( 'server too busy, please try again latter' )
214
+ // wait a bit to prevent client reconnect too fast
215
+ await promise . wait ( 100 )
216
+ socket . send ( 'server too busy, please try again latter' )
217
+ socket . disconnect ( true )
218
+ return
215
219
}
216
220
if ( ! socket . user ) throw new Error ( 'user does not exist in socket' )
217
221
You can’t perform that action at this time.
0 commit comments