clean code

This commit is contained in:
Leonardo Venturini
2024-07-19 12:42:45 -04:00
parent bc55ac2721
commit f169bc81bb
2 changed files with 4 additions and 8 deletions

View File

@@ -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.

View File

@@ -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 = []