fix(telegram): debounce forwarded media-only bursts

This commit is contained in:
Peter Steinberger
2026-03-03 05:51:21 +00:00
parent 094140bdb1
commit 1d7a287cf6

View File

@@ -211,12 +211,14 @@ export const registerTelegramHandlers = ({
cfg, cfg,
commandOptions: { botUsername: entry.botUsername }, commandOptions: { botUsername: entry.botUsername },
}); });
if (entry.debounceLane === "forward") {
// Forwarded bursts often split text + media into adjacent updates.
// Debounce media-only forward entries too so they can coalesce.
return hasDebounceableText || entry.allMedia.length > 0;
}
if (!hasDebounceableText) { if (!hasDebounceableText) {
return false; return false;
} }
if (entry.debounceLane === "forward") {
return true;
}
return entry.allMedia.length === 0; return entry.allMedia.length === 0;
}, },
onFlush: async (entries) => { onFlush: async (entries) => {