-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Description
Steps to reproduce
-
In persistentconversationbot.py, change
persistent=Truetopersistent=False -
Start the bot, give the bot some information to store
-
Stop bot
-
Start bot again, send command
/show_data. It will be empty
Expected behaviour
user_data changed within a conversation should be persisted even if the conversation is not
(i.e., I would expect this)
Actual behaviour
user_data changed within a conversation that is not persisted, will not be persisted
Configuration
Raspbian GNU/Linux 9 (stretch)
Version of Python, python-telegram-bot & dependencies:
python-telegram-bot 11.1.0
certifi 2018.01.18
future 0.17.1
Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]
Research so far:
-
When the conversation is persisted, the
user_datawill only be persisted, ifsingle_file = True. This is because this will triggerdump_singlefile()in picklepersistence.py on update in Conversation. When settingsingle_file = False,user_datawill not be persisted -
Things go south in
update_user_data(). Printing the result ofself.user_data.get(user_id) == data:always gives
Trueeven thoughself.user_data.[user_id]has changed after user input (as one can test by printing it).
I therefore conclude, that self.user_data[user_id] must be changed somewhere along the way before update_user_data() is called. Still, I can't pinpoint, where that happens. Will try and find it.
If you have a clue, please let me know :)