(core) add user and docId to heartbeat logging

Summary: add user and docId to heartbeat logging

Test Plan: checked manually

Reviewers: dsagal

Reviewed By: dsagal

Differential Revision: https://phab.getgrist.com/D2784
pull/18/head
Paul Fitzpatrick 3 years ago
parent ee3a8a2b85
commit 47ea00dea3

@ -274,6 +274,7 @@ export class GristWSConnection extends Disposable {
this.send(JSON.stringify({
beat: 'alive',
url: G.window.location.href,
docId: this._assignmentId,
}));
}

@ -247,8 +247,11 @@ export class Client {
const clientId = this.clientId;
const request = JSON.parse(message);
if (request.beat) {
const profile = this.getProfile();
// this is a heart beat, to keep the websocket alive. No need to reply.
log.rawInfo('heartbeat', {clientId, counter: this._counter, url: request.url});
log.rawInfo('heartbeat', {clientId, counter: this._counter, url: request.url,
docId: request.docId, // caution: trusting client for docId for this purpose.
email: profile?.email, userId: this.getCachedUserId()});
return;
} else {
log.info("%s: onMessage", this, shortDesc(message));

Loading…
Cancel
Save