Merge pull request #1596 from sharelatex/ja-more-client-error-logging

Increase the number and type of events we log

GitOrigin-RevId: 5384beb86f095d673deebe7b17d76668137fc912
This commit is contained in:
Timothée Alby 2019-03-07 10:30:18 -05:00 committed by James Allen
parent b86a949f50
commit 5b5b06307a
2 changed files with 17 additions and 2 deletions

View file

@ -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,

View file

@ -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()
}
}