Skip to content

Message enforcement architecture #24

Open

Description

@ForNeVeR

So, we want to always keep track of what we've sent to both of the chat rooms (XMPP and Telegram). Here I'll describe a general strategy, but it looks like it'll be most useful for XMPP (because the transport is extremely unreliable).

  1. When sending a message to the room, bot should also save that message to the internal storage.
  2. Before sending any additional messages to the same chat, bot should make sure the message it sent has been received. To do that, it just should listen for the room messages and await its' own response.
  3. If the response haven't been received after a timeout (say, 5 minutes), bot should then reconnect to the room (to make sure nothing's wrong with the connection), receive all the room messages through MAM, and then send the message again if it wasn't found in the full history archive.
  4. The bot internal storage should be persistent, so after reboot it still will try to deliver all the messages in the right order.

Yes, our bot should maintain a full history archive (as seen by the server through MAM) and that'll be additional challenge.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions