diff --git a/services/web/public/coffee/editor/ShareJsDoc.coffee b/services/web/public/coffee/editor/ShareJsDoc.coffee index 60344ad235..78d3232994 100644 --- a/services/web/public/coffee/editor/ShareJsDoc.coffee +++ b/services/web/public/coffee/editor/ShareJsDoc.coffee @@ -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 diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index fcc9d3ef4f..5b6eb591a7 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -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] diff --git a/services/web/public/coffee/ide/ConnectionManager.coffee b/services/web/public/coffee/ide/ConnectionManager.coffee index 9556ec1d1c..18be9e007e 100644 --- a/services/web/public/coffee/ide/ConnectionManager.coffee +++ b/services/web/public/coffee/ide/ConnectionManager.coffee @@ -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')