The filter was using fail-open logic (skipping the date check when
msg.Timestamp was falsy), so messages missing a Timestamp bypassed
the filter entirely. Per-User Report aggregates all filtered messages,
making the bug visible as all-time totals regardless of selected range.
Changed both the message and conversation date filter blocks to
fail-closed: when a date range is active, records without a parseable
timestamp are excluded. Also added a backend warning log to surface
any enriched messages that still lack a Timestamp after the
StartTime fallback (commit 421961a).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
New tab in Dashboard switches between the existing Volume Report and a
Per-User view showing message counts aggregated by User_ID. Reuses
existing filteredMessages, processedUserData, date/org filters.
CSV export matches the format Michael sends to the BAIC UK client.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Changed systemctl start to systemctl restart to ensure backend code changes are always picked up during deployment, even when the service is already running.
Previous behavior: systemctl start would do nothing if service was running
New behavior: systemctl restart always stops and starts the service with fresh code
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Fixed bug where filtering by assistant caused errors due to window.assistantDisplayToIdMap being undefined. Removed all window global variable usage for assistant mappings.
Changes:
- VolumeGraph: Now accepts assistantDisplayToIdMap as prop instead of window global
- Dashboard: Passes assistantDisplayToIdMap to VolumeGraph and ExportButton
- ExportButton: Accepts and forwards assistantDisplayToIdMap to dataAggregation
- dataAggregation: Accepts assistantDisplayToIdMap as parameter
- Cleaned up debug logging that referenced window globals
This completes the migration from window globals to React state for all assistant mapping data, fixing the TypeError when selecting assistants from the filter dropdown.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated assistantMapping.js with friendly names for all active assistants:
- Banner & Ad Server Assistant (updated from Copy Assistant)
- Social Assistant
- SEM Assistant
- Email Assistant
- Free Chat
This improves UX by showing descriptive names in the assistant filter dropdown instead of raw IDs.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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 <noreply@anthropic.com>
Added logging to output a sample raw message from Make.com webhook to verify if messages have native timestamp fields (Timestamp, Created_At, etc.). This will help identify the correct field name for message timestamps.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This fixes the critical bug where all conversations and messages were being filtered out (0 results) despite successfully fetching data from the API.
Root causes fixed:
1. Race condition: window.validAssistantIds was undefined when filtering logic ran
2. Overly restrictive filtering: Only assistants with friendly names were shown
3. Assistant ID mismatch: Hardcoded IDs didn't match actual data
Changes in Dashboard.jsx:
- Replaced window global variables with React state (validAssistantIds, assistantDisplayToIdMap, etc.)
- Added guard to prevent filtering until validAssistantIds is initialized
- Removed filter that required friendly names - now all assistants display
- Use raw Assistant_ID as fallback if no friendly name exists
- Fixed useEffect dependencies to properly track state changes
Changes in assistantMapping.js:
- Added mapping for asst_eECsc64ZG3t6HHuvqR9FvoPt (Copy Assistant)
- Kept existing mappings for backwards compatibility
Result: All 469 conversations and 2471 messages now display correctly in the dashboard.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added proper MSAL initialization and redirect handling to ensure popup authentication works correctly. The app now:
- Initializes MSAL instance before rendering
- Handles redirect responses from popup authentication
- Properly processes authentication tokens and updates state
This fixes the issue where users were redirected back to login after successful authentication.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updated deploy.sh to copy .env file to frontend directory before building, ensuring Vite can access environment variables (including VITE_REDIRECT_URI) during the production build process. The temporary .env is cleaned up after build completes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added VITE_REDIRECT_URI and VITE_REDIRECT_URI_DEV environment variables to provide explicit control over Azure AD redirect URIs. Updated authConfig.js to use these variables with automatic environment detection (development vs production).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>