pengrad/java-telegram-bot-api

Stopping the updates listener doesn't cancel running request properly

DespairScent opened this issue · 1 comments

Stopping updates listener and starting it again in a short time causes two streams of requests to run simultaneously, resulting in Update listener error for request {"method":"getUpdates"} with response 409 Conflict: terminated by other getUpdates request; make sure that only one bot instance is running showing continuously.

How to reproduce:

TelegramBot telegramBot = ...;
telegramBot.setUpdatesListener(...);
telegramBot.removeGetUpdatesListener();
telegramBot.setUpdatesListener(...);

Thanks, fixed in 6.9.1