feat(slack): add draft preview cleanup lifecycle

This commit is contained in:
Colin
2026-02-16 16:07:00 -05:00
committed by Peter Steinberger
parent dfd5a79631
commit 087edec93f
3 changed files with 83 additions and 2 deletions

View File

@@ -135,7 +135,8 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
);
}
} else if (mediaCount > 0) {
draftStream?.stop();
await draftStream?.clear();
hasStreamedMessage = false;
}
const replyThreadTs = replyPlan.nextThreadTs();
@@ -215,6 +216,7 @@ export async function dispatchPreparedSlackMessage(prepared: PreparedSlackMessag
const anyReplyDelivered = queuedFinal || (counts.block ?? 0) > 0 || (counts.final ?? 0) > 0;
if (!anyReplyDelivered) {
await draftStream.clear();
if (prepared.isRoomish) {
clearHistoryEntriesIfEnabled({
historyMap: ctx.channelHistories,