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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexrecuenco opened this issue Mar 31, 2025 · 2 comments
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior.

Comments

@alexrecuenco
Copy link
Contributor

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?

@stevkan stevkan self-assigned this May 2, 2025
@stevkan
Copy link
Collaborator
stevkan commented May 2, 2025

@alexrecuenco - Thank you for your patience. Can you provide more information on what it is you are trying to do? Are you trying to utilize a middleware option, like ShowTypingMiddleware, and are experiencing the problem then?

Are you able to include any code I can test with?

@stevkan stevkan added the bug Indicates an unexpected problem or an unintended behavior. label May 2, 2025
@stevkan
Copy link
Collaborator
stevkan commented May 15, 2025

Closing due to inactivity.

568A
@stevkan stevkan closed this as completed May 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

No branches or pull requests

2 participants
0