Skip to content

fix(telegram): retry chat updates after handling failures - #444

Merged
SiddDevZ merged 1 commit into
DuskBotAI:devfrom
pranavgawaii:fix/telegram-chat-delivery-retry
Dec 3, 2026
Merged

SiddDevZ merged 1 commit into
DuskBotAI:devfrom
pranavgawaii:fix/telegram-chat-delivery-retry

Conversation

@pranavgawaii

Copy link
Copy Markdown
Contributor

What and why

Fixes #443.

Telegram chat updates were acknowledged even if handling threw before the message reached a conversation. Polling advanced the saved offset; the webhook returned HTTP 200. The bridge also remembered the failed message ID, so a repeated delivery could be discarded.

This change lets an unhandled bridge error reach the Telegram delivery boundary. Polling keeps its offset and retries after two seconds. The webhook returns HTTP 500 so Telegram can retry. A failed message ID leaves the in-memory duplicate guard.

How it was checked

  • On unchanged dev at ddafc35, the two new loopback regressions failed: polling lost the update and the webhook returned HTTP 200.
  • With this change, 44 affected messenger tests passed, including both new regressions.
  • Repository typecheck and lint passed. Broker tests: 113 passed. Electron tests: 2,255 passed, 8 skipped. Packaged-server smoke passed.
  • The broad Vitest run is still in progress; the complete pnpm test gate has not passed yet.
  • All fixture messages and failure injection were synthetic. No live bot or personal data was used.

Scope and limits

This handles exceptions that escape the chat bridge. A handled error that already produces a user-facing failure response remains a handled update. Telegram can give up after repeated webhook failures, as its Bot API documents.

  • pnpm typecheck, pnpm lint and pnpm test pass
  • New server behavior has regression coverage
  • No secrets, personal data or local paths in the diff

@pranavgawaii
pranavgawaii marked this pull request as ready for review November 29, 2026 11:45
@SiddDevZ
SiddDevZ merged commit 0999836 into DuskBotAI:dev Dec 3, 2026
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants