From 50ef5773416c2c69874a1bd662e745e49d7276aa Mon Sep 17 00:00:00 2001 From: Floke Date: Fri, 6 Mar 2026 12:48:33 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20[30388f42]=20=C3=9Cberspringe=20Jobs=20o?= =?UTF-8?q?hne=20ContactId=20oder=20PersonId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fügt eine Early-Exit-Bedingung zum Worker hinzu, um Jobs zu überspringen, die weder eine ContactId noch eine PersonId enthalten. - Behebt das Problem, dass 'test.ping'-Jobs oder andere fehlerhafte Payloads zu 'FAILED'-Einträgen führen. --- connector-superoffice/worker.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/connector-superoffice/worker.py b/connector-superoffice/worker.py index 2bd593f6..0d953c72 100644 --- a/connector-superoffice/worker.py +++ b/connector-superoffice/worker.py @@ -52,7 +52,7 @@ def process_job(job, so_client: SuperOfficeClient, queue: JobQueue): return ("SKIPPED", msg) # -------------------------------------------- - # 0. Noise Reduction: Filter irrelevant field changes + # 0. ID Extraction & Early Exit for irrelevant jobs person_id = None contact_id = None job_title = payload.get("JobTitle") @@ -77,6 +77,12 @@ def process_job(job, so_client: SuperOfficeClient, queue: JobQueue): elif "PrimaryKey" in payload and "contact" in event_low: contact_id = int(payload["PrimaryKey"]) + # If after all checks, we have no ID, we can't process it. + if not person_id and not contact_id: + msg = f"Skipping job: No ContactId or PersonId could be identified in the payload." + logger.warning(msg) + return ("SKIPPED", msg) + # Fallback/Deep Lookup & Fetch JobTitle if missing if person_id and (not job_title or not contact_id): try: