fix(telegram): prime final preview before stop flush

This commit is contained in:
Ayaan Zaidi
2026-02-26 16:13:24 +05:30
committed by Ayaan Zaidi
parent e273b9851e
commit d9ed2c425a
2 changed files with 40 additions and 0 deletions

View File

@@ -123,6 +123,11 @@ export function createLaneTextDeliverer(params: CreateLaneTextDelivererParams) {
const hadPreviewMessage =
typeof previewMessageIdOverride === "number" || typeof lanePreviewMessageId === "number";
if (stopBeforeEdit) {
if (!hadPreviewMessage && context === "final") {
// If debounce prevented the first preview, replace stale pending partial text
// before final stop() flush sends the first visible preview.
lane.stream.update(text);
}
await params.stopDraftLane(lane);
}
const previewMessageId =