Skip to content

[BUG] context.user_data saved in a conversation is lost upon timeout. #1823

@bsashidh

Description

@bsashidh

Steps to reproduce

  1. In the entry function of a conversation save some data in context.user_data

  2. Set the conversation_timeout of the conversation to some value other than 0. I used it as 10

  3. In the "ConversationHandler.TIMEOUT" state define a callback handler and in that try reading the user_data from context.

Expected behaviour

Should be able to fetch the saved data using context.user_data.get method.

Actual behaviour

I get the following error: AttributeError: 'NoneType' object has no attribute 'get'. In all other states I am able to read the user_data except in the TIMEOUT state.

Configuration

Operating System:
Windows 10

Version of Python, python-telegram-bot & dependencies:
Version of Python 3.7.5
Version of python-telegram-bot 12.4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions