Recover only active groups after restart

Limit restart interruption snapshots, announcements, and recovery queueing to groups that were actively processing. Waiting groups remain compatible in stored context but no longer receive restart recovery signals.
This commit is contained in:
Eyejoker
2026-05-21 04:54:00 +09:00
committed by GitHub
parent fbaca3ab68
commit 77c2d031bc
3 changed files with 75 additions and 21 deletions

View File

@@ -34,6 +34,7 @@ import {
buildRestartAnnouncement,
buildInterruptedRestartAnnouncement,
consumeRestartContext,
getRecoverableInterruptedGroups,
getInterruptedRecoveryCandidates,
inferRecentRestartContext,
type RestartContext,
@@ -196,7 +197,9 @@ async function announceRestartRecovery(
'Sent explicit restart recovery announcement',
);
for (const interrupted of explicitContext.interruptedGroups ?? []) {
for (const interrupted of getRecoverableInterruptedGroups(
explicitContext,
)) {
if (interrupted.chatJid === explicitContext.chatJid) continue;
if (hasRecentRestartAnnouncement(interrupted.chatJid, dedupeSince)) {
continue;
@@ -265,8 +268,8 @@ async function main(): Promise<void> {
(
status,
): status is typeof status & {
status: 'processing' | 'waiting';
} => status.status !== 'inactive',
status: 'processing';
} => status.status === 'processing',
)
.map((status) => ({
chatJid: status.jid,