From d7fca780c2553ebbebc74353af5db990524184b1 Mon Sep 17 00:00:00 2001 From: Floke Date: Fri, 6 Mar 2026 18:16:15 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20[30388f42]=20Worker=20v1.9.10=20-=20Pr?= =?UTF-8?q?=C3=A4zisiere=20Personen-Filter=20f=C3=BCr=20Stammdaten?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Erweitert den Filter für Events auf Änderungen in , , oder . - Schließt die Lücke, die Events in eine Endlosschleife schicken konnte. - Stellt sicher, dass nur wirklich relevante Personen-Updates eine Verarbeitung triggern. --- connector-superoffice/worker.py | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/connector-superoffice/worker.py b/connector-superoffice/worker.py index e4d81787..190ee764 100644 --- a/connector-superoffice/worker.py +++ b/connector-superoffice/worker.py @@ -45,26 +45,29 @@ def process_job(job, so_client: SuperOfficeClient, queue: JobQueue): Returns: (STATUS, MESSAGE) STATUS: 'SUCCESS', 'SKIPPED', 'DELETED', 'RETRY', 'FAILED' """ - logger.info(f"--- [WORKER v1.9.8 - THE FORTRESS] Processing Job {job['id']} ({job['event_type']}) ---") + logger.info(f"--- [WORKER v1.9.9 - ABSOLUTE FILTERS] Processing Job {job['id']} ({job['event_type']}) ---") payload = job['payload'] event_low = job['event_type'].lower() - # --- NOISE REDUCTION: STRICT STAMMDATEN FILTER --- - # We ONLY react to changes in critical fields. Our own UDF updates must be ignored. + # --- NOISE REDUCTION: STRICT STAMMDATEN FILTER (v1.9.9) --- + # We ONLY react to changes in critical fields. + # For .created events, we also check if name/urladdress are explicitly in the payload changes. changes = [c.lower() for c in payload.get("Changes", [])] - if "contact.changed" in event_low: - if "name" not in changes and "urladdress" not in changes: - msg = f"Skipping contact change: No changes to name or website in {changes}." + # RULE: If it's a person event, we ONLY care if name, email, or jobtitle changed (for role mapping). + # If it's a contact event, we ONLY care if name or website changed. + if "person" in event_low: + if "name" not in changes and "email" not in changes and "jobtitle" not in changes and "contact_id" not in changes: + msg = f"Skipping person event: No relevant changes (Name/Email/JobTitle/Mapping) in {changes}." logger.info(f"⏭️ {msg}") return ("SKIPPED", msg) - if "person.changed" in event_low: - if "jobtitle" not in changes and "contact_id" not in changes: - msg = f"Skipping person change: No changes to jobtitle or contact mapping in {changes}." + elif "contact" in event_low: + if "name" not in changes and "urladdress" not in changes: + msg = f"Skipping contact event: No relevant changes (Name/Website) in {changes}." logger.info(f"⏭️ {msg}") return ("SKIPPED", msg) - # ------------------------------------------------- + # --------------------------------------------------------- # --- CIRCUIT BREAKER: DETECT ECHOES ---