Mixing @match methods and 'state' in event_types drops state events
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ibid |
Fix Released
|
Low
|
Stefano Rivera |
Bug Description
If a Processor has event_types = ('message', 'state'), and has an @match method, then event dispatch raises a KeyError on state events, so they never get handled.
If one loads the attached 'bug' plugin, and says "$botname: bug", the bot correctly replies "You said 'bug'", but if a state event occurs, the bot does nothing and the following appears in the log:
DEBUG source.[***]: [***] has online [***]
DEBUG core.dispatcher: Received event from [***] source
ERROR core.dispatcher: Exception occured in Bug processor of bug plugin
Traceback (most recent call last):
File "/home/
processor.
File "/home/
if match is not None:
File "/home/
return self[name]
KeyError: 'message'
The problem seems to be the way patterns are matched in Processor.process
Related branches
- Michael Gorven: Approve
- Jonathan Hitchcock: Approve
- Diff: None lines
Changed in ibid: | |
assignee: | nobody → Stefano Rivera (stefanor) |
importance: | Undecided → Low |
milestone: | none → 0.1 |
status: | New → Confirmed |
Changed in ibid: | |
status: | Confirmed → Fix Released |
Processors weren't designed to handle multiple event types. Previously one
could only specify one event type, but this was changed recently in order to
support NOTICEs. If you need to handle multiple event types you can either
use multiple Processors in a plugin, or override process() and do it
manually. I'm therefore inclined to wontfix this.