From f169bc81bbde74cc6ebf0fe95b2fcf035f6ba5ee Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 19 Jul 2024 12:42:45 -0400 Subject: [PATCH] clean code --- packages/ddp-client/common/livedata_connection.js | 9 +-------- packages/ddp-server/livedata_server_tests.js | 3 +++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/ddp-client/common/livedata_connection.js b/packages/ddp-client/common/livedata_connection.js index ac1d168420..b5c406c7a5 100644 --- a/packages/ddp-client/common/livedata_connection.js +++ b/packages/ddp-client/common/livedata_connection.js @@ -456,7 +456,7 @@ export class Connection { this.ready && this.readyDeps.changed(); }, stop() { - this.connection._sendQueued({ msg: 'unsub', id: id }); + this.connection._send({ msg: 'unsub', id: id }); this.remove(); if (callbacks.onStop) { @@ -1031,13 +1031,6 @@ export class Connection { this._stream.send(DDPCommon.stringifyDDP(obj)); } - // Always queues the call before sending the message - // Used, for example, on subscription.[id].stop() to make sure a "sub" message is always called before an "unsub" message - // https://github.com/meteor/meteor/issues/13212 - _sendQueued(obj) { - this._send(obj, true); - } - // We detected via DDP-level heartbeats that we've lost the // connection. Unlike `disconnect` or `close`, a lost connection // will be automatically retried. diff --git a/packages/ddp-server/livedata_server_tests.js b/packages/ddp-server/livedata_server_tests.js index cbc4e33b1b..87db540846 100644 --- a/packages/ddp-server/livedata_server_tests.js +++ b/packages/ddp-server/livedata_server_tests.js @@ -443,6 +443,9 @@ Tinytest.addAsync("livedata server - waiting for Promise", (test, onComplete) => }) ); +/** + * https://github.com/meteor/meteor/issues/13212 + */ Tinytest.addAsync('livedata server - publish cursor is properly awaited', async function (test) { const messages = []