Expected Behavior
After the server is restarted, one should be able to use the menu buttons from old messages without errors.
Actual Behavior
After the server is restarted, when a user clicks on any button, an exception will be generated indicating that the session key doesn't exists. The user must explicitly use the /start command in order to generate a new session.
2019-06-21 16:06:57,664 - telegram.ext.dispatcher - ERROR - An uncaught error was raised while processing the update
Traceback (most recent call last):
File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/telegram/ext/dispatcher.py", line 279, in process_update
handler.handle_update(update, self)
File "/home/david/cmsysbot-telegram/venv/lib/python3.6/site-packages/telegram/ext/callbackqueryhandler.py", line 143, in handle_update
return self.callback(dispatcher.bot, update, **optional_args)
File "/home/david/cmsysbot-telegram/cmsysbot/controller/general.py", line 75, in disconnect
bridge_ip = user_data["session"].bridge_ip
KeyError: 'session'
Steps to Reproduce the Problem
- Start the bot server.
- Use the
/start command on the chat. The main menu should appear.
- Shutdown and restart the server.
- Now, try to press any button on the menu (without using
/start again). An exception should pop on the console log.
Expected Behavior
After the server is restarted, one should be able to use the menu buttons from old messages without errors.
Actual Behavior
After the server is restarted, when a user clicks on any button, an exception will be generated indicating that the
sessionkey doesn't exists. The user must explicitly use the/startcommand in order to generate a newsession.Steps to Reproduce the Problem
/startcommand on the chat. The main menu should appear./startagain). An exception should pop on the console log.