From fab4914cba7ca27b38779b29eaeb9d9ef98b9f0b Mon Sep 17 00:00:00 2001 From: Hans Ott Date: Thu, 25 Jul 2024 12:05:07 +0200 Subject: [PATCH] Update comment --- library/agent/Context.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/library/agent/Context.ts b/library/agent/Context.ts index 08d71549d..cdaca1804 100644 --- a/library/agent/Context.ts +++ b/library/agent/Context.ts @@ -86,9 +86,10 @@ export function runWithContext(context: Context, fn: () => T) { return fn(); } - // Reset the context - // We should copy the context to avoid modifying the original object - // For performance reasons, we don't copy the cache + // `attackDetected`, `consumedRateLimitForIP` and `consumedRateLimitForUser` + // are carried over if there's an existing context + // Only in case of a top level context, we should reset them first + // This is more for tests than for real usage delete context.cache; delete context.attackDetected; delete context.consumedRateLimitForIP;