Skip to content

tg send doesn't add the sent message to the cache #19

Closed

Description

@neoromantic

tg send returns the message ID but doesn't write the message to messages_cache. The daemon doesn't catch it either: the CLI and the daemon share one session, and Telegram doesn't push updates to the session that made the change. A message sent with tg send reaches the cache only when an unrelated update shows mtcute a gap, or when a later sync job fetches it.

Seen on a real account: with the daemon running, two messages sent to Saved Messages with tg send stayed out of the cache. They appeared within a second of a message sent from a different session.

Also, the CLI's mtcute client saves the new update state to the shared session file, so a daemon started later never sees those messages as updates.

Fix: after a successful send, upsert the message into messages_cache from the response (updateShortSentMessage, or the updateNewMessage/updateNewChannelMessage in updates), with the same peer ID format as the daemon.

Done when tg send followed by tg messages search finds the message with no daemon running.

Activity

  1. added
    bug
    on Oct 21, 2026
  2. added 3 commits that reference this issue on Oct 21, 2026
    19270fe
    d353801
    c82489b
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