From a35245520b25b7edf6a2ba9d2b2536ba6a079d9d Mon Sep 17 00:00:00 2001 From: Leonardo Venturini Date: Wed, 8 Nov 2023 15:48:44 -0400 Subject: [PATCH] add comment --- lib/async/async-hook.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/async/async-hook.js b/lib/async/async-hook.js index 8ee5d673..1b5d074a 100644 --- a/lib/async/async-hook.js +++ b/lib/async/async-hook.js @@ -78,6 +78,12 @@ export const awaitDetector = new AwaitDetector({ const oldBindEnv = Meteor.bindEnvironment; +/** + * We ignore `bindEnvironment` awaits because they pollute the traces with Meteor internals. + * + * To reproduce, go to the test "Tracer - Build Trace - the correct number of async events are captured for methods" + * and remove the awaitDetector.ignore() call below to see the difference. + */ Meteor.bindEnvironment = function (...args) { const func = oldBindEnv.apply(this, args); return function () {