Skip to content

Commit a7a8c81

Browse files
dionisio-bot[bot]cardoso
authored andcommitted
regression: fix presence connections not being updated in DDPStreamer (RocketChat#37887)
Co-authored-by: Matheus Cardoso <5606812+cardoso@users.noreply.github.com>
1 parent 5bcd149 commit a7a8c81

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

ee/apps/ddp-streamer/src/Client.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,11 @@ export class Client extends EventEmitter {
8686
TIMEOUT,
8787
{ leading: true, trailing: false },
8888
);
89+
<<<<<<< HEAD
8990

9091
private _seenPacket = true;
92+
=======
93+
>>>>>>> e9f1930a27 (regression: fix presence connections not being updated in DDPStreamer (#37887))
9194

9295
constructor(
9396
public ws: WebSocket,
@@ -195,18 +198,6 @@ export class Client extends EventEmitter {
195198
this.ws.close(WS_ERRORS.TIMEOUT, WS_ERRORS_MESSAGES.TIMEOUT);
196199
};
197200

198-
private messageReceived = (): void => {
199-
if (this._seenPacket || !this.userId) {
200-
this._seenPacket = true;
201-
return;
202-
}
203-
204-
this._seenPacket = true;
205-
void Presence.updateConnection(this.userId, this.connection.id).catch((err) => {
206-
console.error('Error updating connection presence after heartbeat:', err);
207-
});
208-
};
209-
210201
ping(id?: string): void {
211202
this.send(server.serialize({ [DDP_EVENTS.MSG]: DDP_EVENTS.PING, ...(id && { [DDP_EVENTS.ID]: id }) }));
212203
}
@@ -216,9 +207,6 @@ export class Client extends EventEmitter {
216207
}
217208

218209
handleIdle = (): void => {
219-
if (this.userId) {
220-
this._seenPacket = false;
221-
}
222210
this.ping();
223211
this.timeout = setTimeout(this.closeTimeout, TIMEOUT);
224212
};

0 commit comments

Comments
 (0)