From a45bb9eda51c154230290ddfc6cf6070efccf053 Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Fri, 19 Jul 2024 15:11:01 -0400 Subject: [PATCH] fix conflicting publication name --- packages/ddp-server/livedata_server_tests.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/ddp-server/livedata_server_tests.js b/packages/ddp-server/livedata_server_tests.js index 87db540846..57ed24acb4 100644 --- a/packages/ddp-server/livedata_server_tests.js +++ b/packages/ddp-server/livedata_server_tests.js @@ -471,16 +471,18 @@ Tinytest.addAsync('livedata server - publish cursor is properly awaited', async await coll.insertAsync({ _id: `item_${i}`, title: `Item #${i}` }); } - delete Meteor.server.publish_handlers['asyncPublishCursor']; + const publicationName = `publication_${Random.id()}` - Meteor.publish('asyncPublishCursor', async function (count) { + delete Meteor.server.publish_handlers[publicationName]; + + Meteor.publish(publicationName, async function (count) { return coll.find({}, { limit: count }); }); const reactiveVar = new ReactiveVar(1); const computation = Tracker.autorun(() => { - sub = clientConn.subscribe('asyncPublishCursor', reactiveVar.get()); + sub = clientConn.subscribe(publicationName, reactiveVar.get()); }); await sleep(100)