From 421961afc30cc1a581b1dc8e98f8f2e1acf5f59d Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 18 Nov 2025 14:50:16 -0600 Subject: [PATCH] Add Timestamp field to enriched messages using conversation StartTime fallback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Messages from Make.com webhook have blank timestamp fields, preventing graph aggregation. This fix adds a Timestamp field during message enrichment using the parent conversation's StartTime as a fallback. Logic: - First checks if message has native Timestamp field from webhook - If missing/blank, falls back to parent conversation's StartTime - Ensures all messages have timestamps for proper date aggregation in VolumeGraph This fixes the issue where messages mode shows blank graph despite 2473 messages being filtered successfully. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/app.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/app.py b/backend/app.py index 6d36270..3525c6b 100644 --- a/backend/app.py +++ b/backend/app.py @@ -294,12 +294,17 @@ def get_all_data(): # Enrich message with parent conversation data enriched_msg["User_ID"] = parent_conv.get("User_ID") - + # CRITICAL: Ensure Assistant_ID is properly propagated assistant_id = parent_conv.get("Assistant_ID") enriched_msg["Assistant_ID"] = assistant_id - + enriched_msg["Brand_Voice_Setting"] = parent_conv.get("Brand Voice Setting") + + # Add timestamp to message - use message's native timestamp if available, + # otherwise fallback to parent conversation's StartTime + enriched_msg["Timestamp"] = msg.get("Timestamp") or parent_conv.get("StartTime") + enriched_messages.append(enriched_msg) else: messages_missing_parent += 1