-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a per-chat message queue or similar for incoming messages #88
Comments
For messages from slave channels, @catbaron0 and @wolfsilver has suggested to use a placeholder first create a message at the “correct position”, then process and upload the actual media. This is a viable solution to this problem as it works with majority ETM-supported messages types, and seemingly reduces the first request (the placeholder request) to a single simple request. Telegram Bot API (and user API) allows sending media with resources pre-exist on its server, and modifying message media to one of animation, document, audio, photo, video. To implement this feature, we need to send the placeholder message (preferably a picture) once per bot, and store the file ID somewhere (potentially in the database). On the other hand, this method does not support some message types frequently used by ETM, namely stickers and voice messages, which means these messages could still be out of order. If there is no better solution found for this issue, I‘d recon that this shall be implemented as a partial solution to this problem after ETM has a stable version released (i.e. when ETM has a acceptable amount of tests available). And as always, PRs are welcomed. |
Would it be better (or possible) to send an empty(0 kb) file as the placeholder? |
Telegram (both user API and bot API) rejects empty file to be sent. Even if it’s possible, that might not be as visually appealing and straight forward than a picture. |
Cool. |
That could be done in the caption. |
Currently (since 2.0.0b26), ETM is using a single message worker thread to process all incoming messages from the Bot admin in order to maintain a proper message order, and processing messages from slave channels on a per-call basis sent to Telegram.
While this former measure does help bring a proper message order, this is blocking all incoming messages in all chats when the worker is trying to process large (usually media) messages. This is obviously a behavior that we don‘t want to have in ETM. The latter is seemingly is not blocking, but this could result in a out-of-order message thread when a specific message needs to take more time than others.
I‘d like to look for help/suggestions to solve this problem by maintain a per-chat message order consistency while prevent blocking as far as possible. That could be a per-chat message queue or anything that could serve the same purpose.
The text was updated successfully, but these errors were encountered: