Skip to content

updateDeleteMessages not emitted immediately in private channels — only received after other chat activity #3314

Open
@kolosseo

Description

@kolosseo

Environment:

  • tdl: v7.2.0
  • tdl-tdlib-addon: v1.2.2
  • prebuilt-tdlib: v0.1008012.0
  • Node.js: v20
  • OS: GNU/Linux

Summary:

When using TDLib in a private channel where a bot is present as an admin, the event updateDeleteMessages is not emitted immediately after a user deletes a message via the official Telegram app.

Instead, the update is delayed and only emitted after another message is sent or edited in the same channel. This makes it difficult to detect deletions in near real-time.


Steps to Reproduce:

  1. Add a bot using TDLib to a private channel, with full admin rights.
  2. Delete a message in the channel using the Telegram mobile/desktop client.
  3. No updateDeleteMessages event is received immediately.
  4. Send or edit a message in the channel.
  5. The updateDeleteMessages event is now emitted for the earlier deletion.

Expected behavior:
updateDeleteMessages should be emitted immediately when a message is deleted, even if no other chat activity occurs.

Observed behavior:
TDLib appears to buffer or hold the updateDeleteMessages update until another state-changing event (like a message or reaction) triggers an update propagation.


Notes:

  • The bot is using TDLib via the Node.js tdl wrapper.
  • The issue happens across all private channels where the bot is added.
  • Periodic polling via methods like getAuthorizationState does not unblock the update.
  • Reacting to messages triggers the flush only if the reaction causes a visible change (e.g. first time adding a like).
  • It seems that TDLib does not propagate the deletion unless a concurrent "chat state change" occurs.

Please let me know if more logs, debug traces, or configuration details are needed.
I'd be happy to test any patches or experimental flags.

Thank you for maintaining TDLib — it's an amazing foundation for Telegram bots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions