benjick / meteor-telegram-bot

Telegram bot plugin for Meteor
24 stars 15 forks source link

Prevent duplicate poll results & timeouts from flooding console #15

Closed shrmnk closed 8 years ago

shrmnk commented 8 years ago

I had an issue while developing a bot locally which caused duplicate commands along with my console window flooded with errors about how there was no result to parse in the setInterval. (I was on a weak wifi signal and this caused almost half my packets to be dropped)

Investigating further, I realised that any HTTP.get errors would only call a console.log with the exception, but parsePollResult will still be called.

I added a quick check if(result) before calling parsePollResult and it fixed all my above issues. Also added 2 more checks which prevent calling parsePollResult if there are no updates, and to check if there was duplicate poll data

Also took the chance to format the readme and add missing semicolons.

benjick commented 8 years ago

Hey, I added you as a collaborator so you can push your changes :)

benjick commented 8 years ago

What's your atmosphere username? So you can push there as well

shrmnk commented 8 years ago

Hello benjick!

Thank you! My atmosphere username is shrmn

I had previously published my fork on atmosphere to have it tested out, but its now been hidden

Cheers!

benjick commented 8 years ago
The maintainers for benjick:telegram-bot are:
benjick
shrmn
shrmnk commented 8 years ago

Thanks @benjick , are you satisfied with the quality of the changes I made to get Conversations support? If so, I will go ahead and merge them to the master branch?

benjick commented 8 years ago

Looks good to me. I should import ESLint or something so the code is more consistent but go ahead, if it works