fix(#355): Plugin-Lifecycle Runtime-Registrierungen repariert — Vorher-Status wird jetzt VOR dem registry-Aufruf gelesen (war konstant falsch → Deactivate-Cleanup toter Code); sync_notification_types hinter DB-Statusupdate verschoben; echter Integrationstest tests/test_plugin_lifecycle_service.py (install→activate×2→deactivate×2→re-activate über PluginService) rot→grün
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
fixes #355
This commit is contained in:
@@ -635,15 +635,17 @@ class PluginRegistry:
|
||||
# Activation status is enforced per-request via require_active_plugin().
|
||||
# No dynamic route registration here — prevents duplicate routes.
|
||||
|
||||
# Sync notification types from this plugin
|
||||
await self.sync_notification_types(db)
|
||||
|
||||
# Update DB record
|
||||
# Update DB record FIRST — sync_notification_types() only picks up types
|
||||
# from plugins whose record is already active; running it before the
|
||||
# status update silently skipped the freshly activated plugin's types.
|
||||
record.status = "active"
|
||||
record.active = True
|
||||
await db.flush()
|
||||
self._db_status[name] = record
|
||||
|
||||
# Sync notification types from this plugin (AFTER status update)
|
||||
await self.sync_notification_types(db)
|
||||
|
||||
# Invalidate Redis cache for this plugin across all tenants
|
||||
try:
|
||||
from app.core.redis import get_redis
|
||||
|
||||
Reference in New Issue
Block a user