feat: review uncertain weekly brief deliveries with audit history

This commit is contained in:
2026-09-06 14:37:32 +03:00
parent 99a7f2f571
commit 7a01e4bed7
11 changed files with 141 additions and 15 deletions
+2 -1
View File
@@ -31,6 +31,7 @@ export function createBriefSender({ store, buildBrief, text, html, telegramConfi
});
if (!channels.length) { r.kanalsiz++; continue; }
const batch = outbox?.prepare(briefWeekKey(clock()),user.email,channels.map(channel=>channel.payload));
if (batch?.closed) { r.atlanan+=batch.count; continue; }
if (batch?.changed) { r.bekleyen++; r.hata++; continue; }
const failedChannels = new Set();
for (const [position,channel] of channels.entries()) {
@@ -38,7 +39,7 @@ export function createBriefSender({ store, buildBrief, text, html, telegramConfi
// An earlier channel can await the network while the user disables briefs.
if (store.getData(user.email, 'brief')?.kapali) { r.kapali++; break; }
const claim = outbox?.claim(batch.id,position,clock().getTime());
if (claim?.state === 'accepted') { r.atlanan++; continue; }
if (claim?.state === 'accepted' || claim?.state === 'skipped') { r.atlanan++; continue; }
if (claim && claim.state !== 'sending') {
r.bekleyen++; failedChannels.add(channel.name);
if (claim.state === 'uncertain') failed=true;