jt3k / chat-linker

the bridge between jabber and telegram over chat-bots
MIT License
46 stars 9 forks source link

Telegram -> XMPP loses messages when they're posted frequently #34

Open Newlifer opened 7 years ago

Newlifer commented 7 years ago

Consider the following situation: three Telegram users post some messages in one second, e.g.

(TELEGRAM SIDE)
[12:34:56] <@telegram1> msg1
[12:34:56] <@telegram2> msg2
[12:34:56] <@telegram3> msg3

These messages should be translated by bot without any problems:

(JABBER SIDE, EXPECTED)
[12:34:57] <tg> <@telegram1> msg1
[12:34:57] <tg> <@telegram2> msg2
[12:34:57] <tg> <@telegram3> msg3

But actually some messages will definitely be lost:

(JABBER SIDE, ACTUAL)
[12:34:57] <tg> <@telegram1> msg1
[12:34:57] <tg> <@telegram3> msg3
jt3k commented 7 years ago

Thanx for u report. This is related to #11 issue

ForNeVeR commented 7 years ago

@jt3k hello, I've privately discussed the situation with @Newlifer and I don't think that's related to #11. That's a separate bug. I'll reopen it and update the description.

ForNeVeR commented 7 years ago

I suspect that the problem here is that XMPP server tries to reduce spam and ignores the messages if they're posted too frequently. The simplest solution is to add message throttling mechanism on the XMPP side, and e.g. sleep for 1 second after every message.

jt3k commented 7 years ago

hm... I assumed that this issue about stickers. Ok.

Yes. the "throttled message send" -- that is problem.

l29ah commented 6 years ago

The throttling is a problem only on specific non-default server configurations, i think. I never experienced it anywhere but on jabber.ru.