Merge pull request #17863 from overleaf/ar-set-socket-disconnect-timeout-to-match-wire-value

Set socket disconnect timeout to match wire value

GitOrigin-RevId: b3bfc460090b872500b55b0d5e2167b828ef31f4
This commit is contained in:
Andrew Rumble 2024-04-15 13:37:22 +01:00 committed by Copybot
parent d35204033f
commit 6100954635
2 changed files with 4 additions and 2 deletions

View file

@ -219,13 +219,15 @@ export class ConnectionManager extends EventTarget {
clearInterval(this.idleDisconnectInterval) clearInterval(this.idleDisconnectInterval)
clearTimeout(this.reconnectCountdownInterval) clearTimeout(this.reconnectCountdownInterval)
window.removeEventListener('online', this.onOnline) window.removeEventListener('online', this.onOnline)
window.setTimeout(() => this.disconnect(), 1000 * delay)
this.changeState({ this.changeState({
...this.state, ...this.state,
forceDisconnected: true, forceDisconnected: true,
forcedDisconnectDelay: delay, forcedDisconnectDelay: delay,
error, error,
}) })
setTimeout(() => this.disconnect(), 1000)
} }
private onJoinProjectResponse({ private onJoinProjectResponse({

View file

@ -253,7 +253,7 @@ export default ConnectionManager = (function () {
}) })
// flush changes before disconnecting // flush changes before disconnecting
this.ide.$scope.$broadcast('flush-changes') this.ide.$scope.$broadcast('flush-changes')
setTimeout(() => this.ide.socket.disconnect(), 1000) window.setTimeout(() => this.ide.socket.disconnect(), 1000 * delay)
this.ide.showLockEditorMessageModal( this.ide.showLockEditorMessageModal(
'Please wait', 'Please wait',
`\ `\