diff --git a/connector-superoffice/worker.py b/connector-superoffice/worker.py index 3b789485..08ab8bcb 100644 --- a/connector-superoffice/worker.py +++ b/connector-superoffice/worker.py @@ -306,7 +306,9 @@ def process_job(job, so_client: SuperOfficeClient, queue: JobQueue): contact_patch["UserDefinedFields"][settings.UDF_SUMMARY] = short_summary # --- D. Timestamps & Website Sync --- - if settings.UDF_LAST_UPDATE: + # CRITICAL: We only update the timestamp if we actually have OTHER changes to push. + # Otherwise, we create an infinite loop of self-triggering webhooks. + if settings.UDF_LAST_UPDATE and contact_patch: now_so = f"[D:{datetime.now().strftime('%m/%d/%Y %H:%M:%S')}]" if "UserDefinedFields" not in contact_patch: contact_patch["UserDefinedFields"] = {} contact_patch["UserDefinedFields"][settings.UDF_LAST_UPDATE] = now_so