-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Copy link
Description
Steps to Reproduce
async def callback(update, context):
# current_user_id = update.effective_user.id
# other_user_id = httpx.get("network/call")
# this is updated in persistence
context.user_data['key'] = value
# this is not updated in persistence
context.application.user_data[other_user_id]['key'] = 'value'Expected behaviour
user_data corresponding to other_user_id should be updated in persistence
Actual behaviour
only user_data corresponding to current_user_id is updated in persistence
Operating System
ubuntu 22.04
Version of Python, python-telegram-bot & dependencies
python-telegram-bot 20.0
Bot API 6.4
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0]Relevant log output
No response
Additional Context
I believe this error exists because of the following. Only update.effective_user.id is marked for persistence update.
python-telegram-bot/telegram/ext/_application.py
Lines 1363 to 1368 in 800598c
| def _mark_for_persistence_update(self, *, update: object = None, job: "Job" = None) -> None: | |
| if isinstance(update, Update): | |
| if update.effective_chat: | |
| self._chat_ids_to_be_updated_in_persistence.add(update.effective_chat.id) | |
| if update.effective_user: | |
| self._user_ids_to_be_updated_in_persistence.add(update.effective_user.id) |
Metadata
Metadata
Assignees
Labels
No labels