Skip to content

Telegram chat updates can be acknowledged after a temporary handling failure #443

Done

Description

@pranavgawaii

What happened

A Telegram chat update can be lost if handling throws before the message reaches a conversation. The polling path logs the error and advances the update offset. The webhook path logs the error and returns HTTP 200. Telegram treats both as confirmation, so it does not retry that update.

I reproduced this on unchanged dev at ddafc35 with a loopback Bot API and a temporary conversation-store failure. No live bot or personal data was used. This is the chat channel in server/messengers/, separate from the Telegram watcher in #365.

Expected: an unhandled update remains eligible for retry. Polling must not advance past it, and the webhook must return a retryable non-2xx response.

Steps to reproduce

  1. Connect a bot to the loopback Telegram API and pair its owner.
  2. Make conversation creation throw once, then deliver an ordinary owner message.
  3. In polling mode, the next getUpdates call uses an offset above the failed update ID. The message never reaches the conversation.
  4. In webhook mode, post the same kind of update. The handler returns HTTP 200 despite the failure. Posting the update again is ignored by the bridge duplicate guard.

Proposed scope: propagate unhandled bridge failures, clear the failed message from the in-memory duplicate guard, retain the polling offset with a retry delay, and return HTTP 500 for a failed webhook. Cover both delivery modes with loopback regression tests.

Version

0.2.34 (dev ddafc35)

Platform

macOS

Engine

Not applicable; no bot turn starts.

Logs or screenshots

On unchanged upstream, two new loopback regressions failed:

polling: timed out waiting for the failed update to reach the conversation
webhook: expected HTTP 500 for a failed update, received HTTP 200

Telegram Bot API: https://core.telegram.org/bots/api#getupdates and https://core.telegram.org/bots/api#setwebhook. The API confirms updates when polled with a higher offset and retries unsuccessful webhook responses.

Activity

  1. added
    bug
    on Nov 29, 2026
  2. SiddDevZ commented on Dec 3, 2026

    @SiddDevZ
    Contributor

    Fixed on dev via #444: a Telegram update that fails to be handled is retried (polling keeps its offset, the webhook answers 500). Shipping in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions