mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Merge pull request #2077 from overleaf/bg-fast-reconnect-for-websocket
handle 'retry' messages from realtime GitOrigin-RevId: a896b491f978e37a4afef67e434795b0f7cd301c
This commit is contained in:
@@ -159,6 +159,10 @@ define([], function() {
|
||||
sl_console.log(
|
||||
'[socket.io connectionRejected] session not valid or other connection error'
|
||||
)
|
||||
// real time sends a 'retry' message if the process was shutting down
|
||||
if (err && err.message === 'retry') {
|
||||
return this.tryReconnectWithRateLimit()
|
||||
}
|
||||
// we have failed authentication, usually due to an invalid session cookie
|
||||
return this.reportConnectionError(err)
|
||||
})
|
||||
@@ -286,6 +290,12 @@ Something went wrong connecting to your project. Please refresh if this continue
|
||||
}
|
||||
|
||||
disconnect() {
|
||||
if (this.ide.socket.socket && !this.ide.socket.socket.connected) {
|
||||
sl_console.log(
|
||||
'[socket.io] skipping disconnect because socket.io has not connected'
|
||||
)
|
||||
return
|
||||
}
|
||||
sl_console.log('[socket.io] disconnecting client')
|
||||
return this.ide.socket.disconnect()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user