fix: reanalyze edited messages

This commit is contained in:
MythEclipse
2026-05-14 20:03:02 +07:00
parent dbfc6866f9
commit 44368e646f
16 changed files with 2233 additions and 23 deletions

View File

@@ -117,7 +117,7 @@ async function processBatch(
// Broadcast analyzed messages
for (const row of analyzedRows) {
(globalThis as any).broadcastMessageAnalyzed?.(row);
(globalThis as any).moderationBroadcaster?.messageAnalyzed(row);
}
// Clear error cooldown on success
@@ -147,7 +147,7 @@ async function processBatch(
error: lastError,
});
if (row) {
(globalThis as any).broadcastMessageAnalyzed?.(row);
(globalThis as any).moderationBroadcaster?.messageAnalyzed(row);
}
}

View File

@@ -102,6 +102,13 @@ export async function updateMessageAsEdited(
edited_content: editedContent,
edited_at: editedAt,
type: "edited",
ai_status: "pending",
ai_moderation_flags: null,
ai_moderation_score: null,
ai_moderation_raw: null,
ai_analysis: null,
ai_analyzed_at: null,
ai_error: null,
})
.where(eq(messagesTable.id, messageId));