Correction of own channel post refused: message-not-found #11

Open
opened 2026-11-11 00:17:19 +00:00 by asxpi · 2 comments
Member

What happened

The user's own post in a Telegram broadcast channel (one with a linked discussion group) went out from XMPP and was bridged correctly. But an XEP-0308 correction of it was refused as message-not-found, so the post was never edited on Telegram.

tackygram 0.4.1 (published image), anotherim-server 2026.11.07 (ejabberd). Client: anotherim-js 0.8.0 (flatpak).

Stanzas (client log, ids kept, channel id replaced with CHAN)

Send, 23:59:31Z. It reached Telegram as message 2847, and the echo carries the origin-id:

<message id='1794355170877405' to='CHAN@telegram.example' type='groupchat'>
  <origin-id xmlns='urn:xmpp:sid:0' id='1794355170877405'/><body>…</body></message>

<message from='CHAN@telegram.example/<own nick>' id='1794355170877405' type='groupchat'>
  <origin-id xmlns='urn:xmpp:sid:0' id='1794355170877405'/>
  <stanza-id xmlns='urn:xmpp:sid:0' by='CHAN@telegram.example' id='2847'/> …</message>

Telegram also auto-forwarded the post to the linked discussion group (tg-<group>-21388).

Correction, 00:00:02Z:

<message id='1794355202273182' to='CHAN@telegram.example' type='groupchat'>
  <origin-id xmlns='urn:xmpp:sid:0' id='1794355202273182'/>
  <replace xmlns='urn:xmpp:message-correct:0' id='1794355170877405'/><body>…</body></message>

<message from='CHAN@telegram.example' id='1794355202273182' type='error'>
  <error type='cancel'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
  <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Telegram has no such message of yours to be corrected.</text></error></message>

Gateway log (default level). There was no gotd request failed around it, so messages.editMessage was never called:

2026-11-11T00:00:02 info edit <acc> CHAN of 1794355170877405 refused: message-not-found

Where it likely fails

The refusal comes before any Telegram call. Two places can produce it: target.resolve (engine/internal/engine/edits.go), when SentByXID(xid) misses or its peer differs, or msgRec reporting other. Most likely the xid→msgid record was never written for this send. PutSent happens only in Account.handle, for an UpdateMessageID that arrives while the send is still in pending, and sendRequest deletes it from pending once the RPC returns. A channel post whose UpdateMessageID is not seen by handle before that would leave no record, even though the echo is tagged with the origin-id.

tests/e2e/channels.tcl covers "the user's correction of a post edits it on Telegram", but against the fake. Differences in the real case: a linked discussion group, and a signed post.

No debug log yet. I can rerun with debug on if it helps.

## What happened The user's own post in a Telegram **broadcast channel** (one with a linked discussion group) went out from XMPP and was bridged correctly. But an XEP-0308 correction of it was refused as `message-not-found`, so the post was never edited on Telegram. tackygram 0.4.1 (published image), anotherim-server 2026.11.07 (ejabberd). Client: anotherim-js 0.8.0 (flatpak). ## Stanzas (client log, ids kept, channel id replaced with `CHAN`) Send, 23:59:31Z. It reached Telegram as message 2847, and the echo carries the origin-id: ```xml <message id='1794355170877405' to='CHAN@telegram.example' type='groupchat'> <origin-id xmlns='urn:xmpp:sid:0' id='1794355170877405'/><body>…</body></message> <message from='CHAN@telegram.example/<own nick>' id='1794355170877405' type='groupchat'> <origin-id xmlns='urn:xmpp:sid:0' id='1794355170877405'/> <stanza-id xmlns='urn:xmpp:sid:0' by='CHAN@telegram.example' id='2847'/> …</message> ``` Telegram also auto-forwarded the post to the linked discussion group (`tg-<group>-21388`). Correction, 00:00:02Z: ```xml <message id='1794355202273182' to='CHAN@telegram.example' type='groupchat'> <origin-id xmlns='urn:xmpp:sid:0' id='1794355202273182'/> <replace xmlns='urn:xmpp:message-correct:0' id='1794355170877405'/><body>…</body></message> <message from='CHAN@telegram.example' id='1794355202273182' type='error'> <error type='cancel'><item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/> <text xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>Telegram has no such message of yours to be corrected.</text></error></message> ``` Gateway log (default level). There was no gotd `request failed` around it, so `messages.editMessage` was never called: ``` 2026-11-11T00:00:02 info edit <acc> CHAN of 1794355170877405 refused: message-not-found ``` ## Where it likely fails The refusal comes before any Telegram call. Two places can produce it: `target.resolve` (`engine/internal/engine/edits.go`), when `SentByXID(xid)` misses or its peer differs, or `msgRec` reporting `other`. Most likely the xid→msgid record was never written for this send. `PutSent` happens only in `Account.handle`, for an `UpdateMessageID` that arrives while the send is still in `pending`, and `sendRequest` deletes it from `pending` once the RPC returns. A channel post whose `UpdateMessageID` is not seen by `handle` before that would leave no record, even though the echo is tagged with the origin-id. `tests/e2e/channels.tcl` covers "the user's correction of a post edits it on Telegram", but against the fake. Differences in the real case: a linked discussion group, and a signed post. No debug log yet. I can rerun with debug on if it helps.
Author
Member

Same incident, client side: another-im/anotherim-js#99 (another-im/anotherim-js#99). After this refused correction, deleting the post in anotherim-js sent no retraction.

Same incident, client side: another-im/anotherim-js#99 (https://dev.another.im/another-im/anotherim-js/issues/99). After this refused correction, deleting the post in anotherim-js sent no retraction.
Owner

Fixed in tackygram 0.4.2: an XMPP id made of digits only was taken as a Telegram message number, so the correction pointed at a message that does not exist (MESSAGE_ID_INVALID). The channel echo race that could double a post is fixed in the same release.

Fixed in [tackygram 0.4.2](https://dev.another.im/another-im/tackygram/releases/tag/v0.4.2): an XMPP id made of digits only was taken as a Telegram message number, so the correction pointed at a message that does not exist (MESSAGE_ID_INVALID). The channel echo race that could double a post is fixed in the same release.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
another-im/tackygram#11
No description provided.