Merge pull request #43 from wagesj45/codex/fix-uncaught-syntaxerror-with-break-inside-queue-processing

Fix async rule loop
This commit is contained in:
Jordan Wages 2025-06-26 17:21:50 -05:00 committed by GitHub
commit a8a4a4b4dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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