lukefx / hubot-telegram

Hubot adapter for Telegram
MIT License
160 stars 42 forks source link

Slow connectivity causes duplicate messages #55

Closed arcturial closed 4 years ago

arcturial commented 8 years ago

I think we should change the polling mechanism from setInterval to setTimeout

If the bot experiences slow internet connectivity, the setInterval function will trigger the callback multiple times before the first callback is complete and the message offset is updated. This results in the same messages being handled multiple times.

If we change this to be setTimeout and recreate a new timeout once the old one completes, this problem should not occur anymore.

The bot will then effectively "lag" until the getUpdates call is complete or fails. Thoughts, @lukefx?

kiliankoe commented 7 years ago

I'm experiencing the same issue 😕

lukefx commented 4 years ago

This should be fixed in #72