Skip to content

[Feature Request]: handling multiple selectors for single event on ActivityProcessor.execute_middleware_chain #227

@aviadpriel

Description

@aviadpriel

Bug Description

When multiple handlers match an activity (e.g., multiple on_invoke handlers), the middleware chain returns the response from the first handler that executes, even if that handler returns None to signal "not handled".
The expected behavior is that the chain should return the first non-None response from any handler in the chain.

Handlers returning None may not call ctx.next() because None semantically means "pass"

Steps to Reproduce

  1. Register multiple app.on_invoke() handlers
  2. First handler checks activity name, returns None if not matching
  3. Second handler should handle the event but never executes (or its response is ignored)

Expected Behavior

allow multipal on_invokes and or better selectores intrafaces

Actual Behavior

see Steps to Reproduce

SDK Version

2.0.0a6

Python Version

313

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions