There's a few shortcomings with the current implementation of message replies:
- sending a message to a network currently expects to return the associated message ID immediately, but this prevents an asynchronous design:
- most networks will require a response from the server to assign the ID, blocking the main thread
- XMPP does not even get the assigned ID as a response to the sending action, but in a separate message
- a bridged message may be split into several message for sending, and the current implementation only allows to return 1 message ID:
- a message may be split because of length limit
- or because separate attachments (eg. images) require separate messages
- matterbridge does not store original message bodies internally, and thus requires each bridge to destructure/reformat the original message quote on its own (which is error prone, and would force each bridge to implement a message cache to keep the texts around)
from my understanding, the mapping of original ID -> bridge IDs is untyped, therefore collisions are possible actually it's not exactly typed but all IDs are prefixed with the protocol, see here
We should definitely come up with a new architecture which would allow us to send every new message in a separate goroutine and stop blocking the main thread.
There's a few shortcomings with the current implementation of message replies:
from my understanding, the mapping of original ID -> bridge IDs is untyped, therefore collisions are possibleactually it's not exactly typed but all IDs are prefixed with the protocol, see hereWe should definitely come up with a new architecture which would allow us to send every new message in a separate goroutine and stop blocking the main thread.