From 1cb07b3fcbdb229ebaaacf8c42b4e54e7bf426a2 Mon Sep 17 00:00:00 2001 From: Julian Waller Date: Mon, 3 Feb 2025 11:15:50 +0000 Subject: [PATCH] chore: fix double cleanup in publication --- meteor/server/publications/lib/rundownsObserver.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meteor/server/publications/lib/rundownsObserver.ts b/meteor/server/publications/lib/rundownsObserver.ts index 2c5efea890..44bd0fc40b 100644 --- a/meteor/server/publications/lib/rundownsObserver.ts +++ b/meteor/server/publications/lib/rundownsObserver.ts @@ -30,11 +30,15 @@ export class RundownsObserver implements Meteor.LiveQueryHandle { if (this.#disposed) return if (!this.#changed) return this.#cleanup?.() + this.#cleanup = undefined const changed = this.#changed this.#cleanup = await changed(this.rundownIds) - if (this.#disposed) this.#cleanup?.() + if (this.#disposed) { + this.#cleanup?.() + this.#cleanup = undefined + } }, REACTIVITY_DEBOUNCE) private constructor(onChanged: ChangedHandler) { @@ -109,5 +113,6 @@ export class RundownsObserver implements Meteor.LiveQueryHandle { this.#rundownsLiveQuery.stop() this.#changed = undefined this.#cleanup?.() + this.#cleanup = undefined } }