Dispatcharr/apps/connect
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
..
handlers enhanced webhooks to support custom headers and payload templates 2026-02-25 10:59:45 -05:00
migrations Enhancement: VOD start/stop notifications and system events. 2026-04-23 18:03:02 -05:00
tests fix: plugin event dispatch crashes on first disabled plugin (#1231) 2026-05-09 16:16:14 +01:00
__init__.py initial connect feature 2026-02-08 09:29:22 -05:00
api_urls.py initial connect feature 2026-02-08 09:29:22 -05:00
api_views.py Bug Fix: Fixed several incorrect or incomplete OpenAPI (@extend_schema) schemas across the API 2026-04-11 17:02:07 -05:00
apps.py initial connect feature 2026-02-08 09:29:22 -05:00
models.py Enhancement: VOD start/stop notifications and system events. 2026-04-23 18:03:02 -05:00
serializers.py added endpoint for testing connections with a dummy payload 2026-02-15 07:36:08 -05:00
utils.py fix: plugin event dispatch crashes on first disabled plugin (#1231) 2026-05-09 16:16:14 +01:00