From ab61c81d2baed2820f64255182de12fd0af132a0 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Fri, 31 Jul 2026 09:19:45 +0200 Subject: [PATCH] gate: worker flush after plugin activation to detect swallowed RLS errors --- app/core/worker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/core/worker.py b/app/core/worker.py index 430716c..053b5bc 100644 --- a/app/core/worker.py +++ b/app/core/worker.py @@ -147,10 +147,12 @@ async def on_startup(ctx: dict[str, Any]) -> None: try: await set_tenant_context(db, tenant_id) await plugin.on_activate(db, container, event_bus) + # Flush to detect any RLS errors that were swallowed by the plugin + await db.flush() except Exception as exc: # RLS may block duplicate cron job inserts — rollback and continue # The cron jobs are already registered from the API container startup - logger.warning(f"Worker: plugin {name} activation failed for tenant {tenant_id}: {exc}") + logger.warning(f"Worker: plugin {name} activation issue for tenant {tenant_id}: {exc}") await db.rollback() activation_failed = True break