Skip to content

Filter Event Handler Expression - #197

Merged
ccrisan merged 3 commits into
mainfrom
feature/filter-event-handler-expression
Apr 13, 2026
Merged

Filter Event Handler Expression#197
ccrisan merged 3 commits into
mainfrom
feature/filter-event-handler-expression

Conversation

@ccrisan

@ccrisan ccrisan commented Apr 13, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for an expression filter on FilterEventHandler so handlers can accept/reject events based on a parsed core expression, and introduces a comprehensive unit test suite for FilterEventHandler filtering and dispatch behavior.

Changes:

  • Parse optional filter["expression"] into a core_expressions.Expression during filter preparation.
  • Evaluate the filter expression inside accepts() to gate event acceptance.
  • Add unit tests covering attribute/value/type filtering, expression filtering, lazy filter preparation, dispatch behavior, and state getters.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
qtoggleserver/lib/filtereventhandler.py Adds parsing/storage of a filter expression and evaluates it during accepts() to decide whether to handle an event.
tests/unit/qtoggleserver/lib/test_filtereventhandler.py New unit tests validating filter matching behavior (attrs, transitions, port values, event types, expressions) and handler dispatch/state updates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread qtoggleserver/lib/filtereventhandler.py Outdated
@ccrisan
ccrisan merged commit f1fa60d into main Apr 13, 2026
7 checks passed
@ccrisan
ccrisan deleted the feature/filter-event-handler-expression branch April 13, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants