Fix rule processing loop

This commit is contained in:
Jordan Wages 2025-06-26 17:18:40 -05:00
commit 492c2404cd

View file

@ -106,6 +106,8 @@ async function applyAiRules(idsInput) {
try { try {
const full = await messenger.messages.getFull(id); const full = await messenger.messages.getFull(id);
const text = buildEmailText(full); const text = buildEmailText(full);
for (const rule of aiRules) {
const cacheKey = await sha256Hex(`${id}|${rule.criterion}`); const cacheKey = await sha256Hex(`${id}|${rule.criterion}`);
const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey); const matched = await AiClassifier.classifyText(text, rule.criterion, cacheKey);
if (matched) { if (matched) {