From 0f24e38e1a5e95ad88e111d15f8fce45898343f4 Mon Sep 17 00:00:00 2001 From: Roberto Date: Tue, 18 Aug 2026 21:00:16 +0200 Subject: [PATCH] fix(socketio): send clientTracking.updatePosition without an ack The official web frontend emits this event without an acknowledgement callback. Requesting one turns every cursor movement into a promise that can only fail: `ClientManager` calls `updatePosition` without a `.catch`, so a slow or missing acknowledgement produces both a 5s timeout and an unhandled promise rejection, several times per second while typing. The `Alt` (HTTP polling) scheme keeps the previous path, since there the emit is implemented over a request/response cycle. --- src/api/socketio.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/api/socketio.ts b/src/api/socketio.ts index 2cfd9e6..0e18374 100644 --- a/src/api/socketio.ts +++ b/src/api/socketio.ts @@ -432,6 +432,14 @@ export class SocketIOAPI { * @returns {Promise} */ async updatePosition(doc_id:string, row:number, column:number) { + // Fire-and-forget, like the official frontend: it passes no acknowledgement + // callback here. Asking for an ack turns every cursor move into a promise that + // can only fail: the caller in ClientManager does not `catch` it, so a slow or + // missing ack produces a 5s timeout *and* an unhandled rejection. + if (this.scheme!=='Alt') { + this.socket.emit('clientTracking.updatePosition', {row, column, doc_id}); + return; + } return this.emit('clientTracking.updatePosition', {row, column, doc_id}) .then(() => { return;