From 5b5b06307a97819b2c08dd6adf71bf24a4e02674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Alby?= Date: Thu, 7 Mar 2019 10:30:18 -0500 Subject: [PATCH] Merge pull request #1596 from sharelatex/ja-more-client-error-logging Increase the number and type of events we log GitOrigin-RevId: 5384beb86f095d673deebe7b17d76668137fc912 --- services/web/public/src/ide/editor/Document.js | 17 ++++++++++++++++- services/web/public/src/ide/services/ide.js | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/services/web/public/src/ide/editor/Document.js b/services/web/public/src/ide/editor/Document.js index 1387e274ef..789cc5c9a4 100644 --- a/services/web/public/src/ide/editor/Document.js +++ b/services/web/public/src/ide/editor/Document.js @@ -395,7 +395,8 @@ define([ doc_id: this.doc_id, remote_doc_id: update != null ? update.doc : undefined, wantToBeJoined: this.wantToBeJoined, - update + update, + hasDoc: (this.doc != null) }) if ( @@ -420,6 +421,9 @@ define([ (update != null ? update.doc : undefined) === this.doc_id && this.doc != null ) { + this.ide.pushEvent('received-update:processing', { + update + }) this.doc.processUpdateFromServer(update) if (!this.wantToBeJoined) { @@ -476,6 +480,10 @@ define([ callback = function(error) {} } if (this.doc != null) { + this.ide.pushEvent('joinDoc:existing', { + doc_id: this.doc_id, + version: this.doc.getVersion() + }) return this.ide.socket.emit( 'joinDoc', this.doc_id, @@ -496,6 +504,9 @@ define([ } ) } else { + this.ide.pushEvent('joinDoc:new', { + doc_id: this.doc_id + }) return this.ide.socket.emit( 'joinDoc', this.doc_id, @@ -505,6 +516,10 @@ define([ return callback(error) } this.joined = true + this.ide.pushEvent('joinDoc:inited', { + doc_id: this.doc_id, + version + }) this.doc = new ShareJsDoc( this.doc_id, docLines, diff --git a/services/web/public/src/ide/services/ide.js b/services/web/public/src/ide/services/ide.js index bf66d1940b..adc9379cd0 100644 --- a/services/web/public/src/ide/services/ide.js +++ b/services/web/public/src/ide/services/ide.js @@ -37,7 +37,7 @@ define(['base'], function(App) { meta = {} } this.recentEvents.push({ type, meta, date: new Date() }) - if (this.recentEvents.length > 40) { + if (this.recentEvents.length > 100) { return this.recentEvents.shift() } }