- Modified to instruct the Gemini model to use checkboxes for "Nächste Schritte / Offene To-Dos".
- Updated to replace bullet points with checkboxes in all "Nächste Schritte / Offene To-Dos" sections.
This commit addresses the issue of duplicate jobs being created by the SuperOffice connector.
The root cause was identified as a race condition where SuperOffice would send multiple webhooks in quick succession for the same entity, leading to multiple identical jobs in the queue.
The solution involves several layers of improvement:
1. **Ingress De-duplication:** The now checks for existing jobs for the same entity *before* adding a new job to the queue. This is the primary fix and prevents duplicates at the source.
2. **DB Schema Enhancement:** The table schema in was extended with an column to allow for reliable and efficient checking of duplicate entities.
3. **Improved Logging:** The log messages in for job retries (e.g., when waiting for the Company Explorer) have been made more descriptive to avoid confusion and false alarms.
Erreicht: Die Stabilität des SuperOffice Connectors wurde maßgeblich verbessert, um Endlos-Schleifen bei der Job-Verarbeitung zu verhindern und die Dashboard-Anzeige zu optimieren. Die Verarbeitung relevanter Änderungen wurde präzisiert.
Details der Implementierung:
* Stabile Job-Verarbeitung (Poison Pill): Ein Poison Pill-Mechanismus wurde in queue_manager.py eingeführt. Jobs werden nun nach maximal 5 fehlgeschlagenen Versuchen automatisch als FAILED markiert.
* Robuste SuperOffice API-Client-Authentifizierung: Die Fehlerbehandlung im superoffice_client.py wurde gehärtet. Authentifizierungsfehler und andere kritische API-Probleme lösen jetzt spezifische Exceptions aus.
* Behebung des Worker-Startfehlers: Ein ImportError (ContactNotFoundException) im Worker wurde behoben.
* Präzise Trigger-Logik: Eine Neubewertung von Accounts wird jetzt nur noch bei Änderungen an den Feldern name, urladdress, urls oder dem Vertical-UDF (SuperOffice:83) ausgelöst.
* Korrekte Datumsanzeige im Dashboard: Die Dashboard-Formatierungslogik wurde angepasst, um updated_at-Zeitstempel anzuzeigen.
Document the newly implemented de-duplication logic in the SuperOffice Connector README. This explains the problem of duplicate 'contact.created' webhooks from SuperOffice and how the worker now skips redundant jobs.
SuperOffice sends two 'contact.created' webhooks for a single new contact. This caused the connector to process the same entity twice, leading to duplicate entries and logs.
This commit introduces a de-duplication shield in the worker:
- A new method is added to to check for jobs with the same company name that are either 'PROCESSING' or 'COMPLETED' within the last 5 minutes.
- The worker now fetches the company name upon receiving a job, updates the job record with the name, and then calls the new de-duplication method.
- If a duplicate event is detected, the job is skipped, preventing redundant processing.
Implementiert:
* **End-to-End Test-Button pro Lead:** Ein neuer Button "🧪 Test-Versand (an floke.com@gmail.com)" wurde in der Lead-Detailansicht hinzugefügt, um spezifische Leads sicher zu testen.
* **Verbesserte E-Mail-Generierung:**
* Der LLM-Prompt wurde optimiert, um redundante Termin-Vorschläge und Betreffzeilen im generierten E-Mail-Text zu vermeiden.
* Der E-Mail-Body wurde umstrukturiert für eine klarere und leserlichere Integration des LLM-generierten Textes und der dynamischen Terminvorschläge.
* **HTML-Signatur mit Inline-Bildern:**
* Ein Skript zum Extrahieren von HTML-Signaturen und eingebetteten Bildern aus -Dateien wurde erstellt und ausgeführt.
* Die -Funktion wurde überarbeitet, um die neue HTML-Signatur und alle zugehörigen Bilder dynamisch als Inline-Anhänge zu versenden.
* **Bugfixes und verbesserte Diagnosefähigkeit:**
* Der für wurde durch Verschieben der Funktion in den globalen Bereich behoben.
* Die im Kalender-Abruf wurde durch die explizite Übergabe der Zeitzoneninformation an die Graph API korrigiert.
* Fehlende Uhrzeit in Teams-Nachrichten behoben.
* Umfassendes Logging wurde in kritischen Funktionen (, , ) implementiert, um die Diagnosefähigkeit bei zukünftigen Problemen zu verbessern.
- Enhanced Teams Adaptive Card with precise email send time and re-added emojis to action buttons ("✅ JETZT Aussenden", "❌ STOP Aussendung").
- Modified email sending logic to include HTML signature from `signature.html` and an inline banner image from `RoboPlanetBannerWebinarEinladung.png`.
- Documented future enhancements in `lead-engine/README.md`:
- Race-condition protection for calendar bookings with a live calendar check.
- Integration of booking confirmation pages into the WordPress website (iFrame first, then API integration).
This commit introduces comprehensive guidelines for managing development and production environments, addressing the user's strategic questions regarding workflow, webhook handling, and secure email sending.
- **Teil 4: Entwicklungs- vs. Produktions-Workflow:** Documents the 'separated worlds' approach for development on Synology and production on the Wackler VM, detailing configuration separation, webhook handling, and safe email testing.
- **Teil 5: Alternative - Single-Host-Setup:** Provides a robust strategy for running both development and production environments on a single VM, emphasizing directory structure, port conflict resolution, and guaranteed database isolation via Docker volumes.
These additions clarify the operational guidelines for maintaining system stability and data integrity post-migration.
- Fixed Nginx proxy for /feedback/ and /lead/ routes.
- Restored manager.py to use persistent SQLite DB and corrected test lead triggers.
- Refined Dockerfile for lead-engine to ensure clean dependency installs.
- Applied latest API configs (.env) to lead-engine and duckdns services.
- Updated documentation (GEMINI.md, readme.md, RELOCATION.md, lead-engine/README.md) to reflect final state and lessons learned.
- Committed all pending changes to main branch.