Commit graph

6 commits

Author SHA1 Message Date
R3XCHRIS
65e7b55200 fix: plugin event dispatch crashes on first disabled plugin (#1231)
trigger_event in apps/connect/utils.py iterates pm.list_plugins() and
on disabled plugins emits a debug log that accesses dict items as if
they were attributes:

  logger.debug(f"Skipping disabled plugin id={plugin.key} name={plugin.name}")

Python evaluates f-string arguments eagerly even when the logger
discards the message at INFO level, so this raises AttributeError on
the first disabled plugin encountered. The exception bubbles out of
trigger_event with no try/except in the loop, aborting dispatch for
every plugin sorted after the disabled one.

Effect for users: any plugin subscribed to events via `events: [...]`
on an action silently never receives events whenever any
alphabetically-earlier plugin is disabled. Manual button actions still
work, masking the failure as a plugin bug rather than a dispatch one.

Fix: replace the two attribute accesses with dict access. Add a
regression test under apps/connect/tests/ that mocks PluginManager to
return [disabled, enabled-with-events], asserts the enabled plugin's
action is dispatched, and a sanity check that non-matching events
aren't dispatched. Verified the test fails against the original code
with the expected AttributeError and passes with the fix.
2026-05-09 16:16:14 +01:00
dekzter
4d6351507f enhanced webhooks to support custom headers and payload templates 2026-02-25 10:59:45 -05:00
dekzter
3b0a890e94 fixed circular import 2026-02-13 11:48:59 -05:00
dekzter
fe9854c522 more supported events 2026-02-12 19:28:43 -05:00
dekzter
e6ffeb19de added event support to plugins 2026-02-11 19:50:11 -05:00
dekzter
24f812dc4d initial connect feature 2026-02-08 09:29:22 -05:00