From 492c2404cdf0c5b0104d5596af3a65b826894e18 Mon Sep 17 00:00:00 2001 From: Jordan Wages Date: Thu, 26 Jun 2025 17:18:40 -0500 Subject: [PATCH] Fix rule processing loop --- background.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/background.js b/background.js index 660dbfb..1463ee7 100644 --- a/background.js +++ b/background.js @@ -106,8 +106,10 @@ async function applyAiRules(idsInput) { try { const full = await messenger.messages.getFull(id); const text = buildEmailText(full); - const cacheKey = await sha256Hex(`${id}|${rule.criterion}`); - const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey); + + for (const rule of aiRules) { + const cacheKey = await sha256Hex(`${id}|${rule.criterion}`); + const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey); if (matched) { for (const act of (rule.actions || [])) { if (act.type === 'tag' && act.tagKey) {