mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Log more information in the client side errors
This commit is contained in:
parent
5efd19ffc4
commit
a99783edc7
3 changed files with 15 additions and 2 deletions
|
@ -94,8 +94,11 @@ define [
|
|||
|
||||
INFLIGHT_OP_TIMEOUT: 10000
|
||||
_startInflightOpTimeout: (update) ->
|
||||
meta =
|
||||
v: update.v
|
||||
op_sent_at: new Date()
|
||||
timer = setTimeout () =>
|
||||
@_handleError new Error("Doc op was not acknowledged in time"), v: update.v
|
||||
@_handleError new Error("Doc op was not acknowledged in time"), meta
|
||||
, @INFLIGHT_OP_TIMEOUT
|
||||
@_doc.inflightCallbacks.push () =>
|
||||
clearTimeout timer
|
||||
|
|
|
@ -158,7 +158,13 @@ define [
|
|||
}
|
||||
|
||||
reportError: (error, meta = {}) ->
|
||||
meta.client_id = @socket.socket.sessionid
|
||||
meta.client_id = @socket?.socket?.sessionid
|
||||
meta.transport = @socket?.socket?.transport?.name
|
||||
meta.client_now = new Date()
|
||||
meta.last_connected = @connectionManager.lastConnected
|
||||
meta.second_last_connected = @connectionManager.secondLastConnected
|
||||
meta.last_disconnected = @connectionManager.lastDisconnected
|
||||
meta.second_last_disconnected = @connectionManager.secondLastDisconnected
|
||||
errorObj = {}
|
||||
for key in Object.getOwnPropertyNames(error)
|
||||
errorObj[key] = error[key]
|
||||
|
|
|
@ -8,11 +8,15 @@ define [
|
|||
@socket = @ide.socket
|
||||
@socket.on "connect", () =>
|
||||
@connected = true
|
||||
@secondLastConnected = @lastConnected
|
||||
@lastConnected = new Date()
|
||||
@hideModal()
|
||||
@cancelReconnect()
|
||||
|
||||
@socket.on 'disconnect', () =>
|
||||
@connected = false
|
||||
@secondLastDisconnected = @lastDisconnected
|
||||
@lastDisconnected = new Date()
|
||||
@ide.trigger "disconnect"
|
||||
setTimeout(=>
|
||||
ga('send', 'event', 'editor-interaction', 'disconnect')
|
||||
|
|
Loading…
Reference in a new issue