8000 [Bug] Middleware set typing says it accepts turnContext, but function doesn't · Issue #2221 · microsoft/botbuilder-python · GitHub
[go: up one dir, main page]

Skip to content
[Bug] Middleware set typing says it accepts turnContext, but function doesn't #2221
Closed
@alexrecuenco

Description

@alexrecuenco

https://github.com/microsoft/botbuilder-python/blob/13ee2f25ec3b7470fc4f570d7624b59487a98d38/libraries/botbuilder-core/botbuilder/core/middleware_set.py#L74C1-L75C1

The way to provide the optional parameter, similar to how javascript would need it requires the use of Protocol, the Callable interface is not sufficient.

As it is, the typing says that you require to provide a turn_context to logic, but if you provide it, the function call_next_middleware breaks.

To solve this I am not sure what is the best approach, but as an initial point, could this be added? so at least if you send a turn_context it doesn't throw an error?

async def call_next_middleware(turn_context: TurnContext = None, /):

Otherwise, can that parameter, turnContext, be removed?

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or an unintended behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0