diff --git a/app/client/components/GristWSConnection.ts b/app/client/components/GristWSConnection.ts index df443389..05871f59 100644 --- a/app/client/components/GristWSConnection.ts +++ b/app/client/components/GristWSConnection.ts @@ -274,6 +274,7 @@ export class GristWSConnection extends Disposable { this.send(JSON.stringify({ beat: 'alive', url: G.window.location.href, + docId: this._assignmentId, })); } diff --git a/app/server/lib/Client.ts b/app/server/lib/Client.ts index 3d68b51c..125d542e 100644 --- a/app/server/lib/Client.ts +++ b/app/server/lib/Client.ts @@ -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));