fix(telegram): materialize dm draft final to prevent duplicate sends#34318
fix(telegram): materialize dm draft final to prevent duplicate sends#34318
Conversation
Greptile SummaryThis PR fixes duplicate final message sends in Telegram DM draft streaming by materializing the in-flight draft preview into a permanent message instead of issuing a separate Confidence Score: 5/5
Last reviewed commit: d3612f4 |
d3612f4 to
16c977a
Compare
|
@GodsBoy the duplicate bug should be fixed after this merge. Please let me know if you still face it! |
|
@obviyus Thanks for picking this up so fast! Will test as soon as the npm release drops and report back. Really appreciate the quick turnaround. |
* main: (92 commits) fix: preserve raw media invoke for HTTP tool clients (openclaw#34365) fix: prevent nodes media base64 context bloat (openclaw#34332) docs(changelog): credit @Brotherinlaw-13 for openclaw#34318 fix(telegram): materialize dm draft final to avoid duplicates fix: relay ACP sessions_spawn parent streaming (openclaw#34310) (thanks @vincentkoc) (openclaw#34310) fix: kill stuck ACP child processes on startup and harden sessions in discord threads (openclaw#33699) feat(ios): add Live Activity connection status + stale cleanup (openclaw#33591) chore(docs): add plugins refactor changelog entry Chore: remove accidental .DS_Store artifact Plugins/zalouser: migrate to scoped plugin-sdk imports Plugins/zalo: migrate to scoped plugin-sdk imports Plugins/whatsapp: migrate to scoped plugin-sdk imports Plugins/voice-call: migrate to scoped plugin-sdk imports Plugins/twitch: migrate to scoped plugin-sdk imports Plugins/tlon: migrate to scoped plugin-sdk imports Plugins/thread-ownership: migrate to scoped plugin-sdk imports Plugins/test-utils: migrate to scoped plugin-sdk imports Plugins/talk-voice: migrate to scoped plugin-sdk imports Plugins/synology-chat: migrate to scoped plugin-sdk imports Plugins/qwen-portal-auth: migrate to scoped plugin-sdk imports ...
Summary
Keep Telegram DM streaming on
sendMessageDraftpreviews, but avoid duplicate final sends by materializing draft previews into one permanent message on final delivery.Problem
sendMessageDraftpreview updates in DMs do not produce amessage_id, so finalization cannot edit in place. Existing lane behavior then sends a second final payload, creating duplicates.Fix
draft, payload is text-only, no inline buttons, andmaterializeis availablematerialize()sendPayloadWhy this over forcing
messagetransportThis preserves the new Telegram DM draft-streaming UX while still guaranteeing single final delivery.
Tests
bunx vitest run src/telegram/lane-delivery.test.ts src/telegram/draft-stream.test.ts src/telegram/bot-message-dispatch.test.tsbunx oxfmt --check src/telegram/lane-delivery.ts src/telegram/lane-delivery.test.tsFixes #33492