mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05: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:
parent
87605d835e
commit
b591c950e0
1 changed files with 10 additions and 0 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue