Skip to content

fix: cloud dashboard message duplication and attribution#183

Merged
khaliqgant merged 1 commit intomainfrom
fix/cloud-dashboard-message-duplication
Jan 14, 2026
Merged

fix: cloud dashboard message duplication and attribution#183
khaliqgant merged 1 commit intomainfrom
fix/cloud-dashboard-message-duplication

Conversation

@khaliqgant
Copy link
Copy Markdown
Member

Summary

Fixes message duplication and incorrect attribution when sending messages from the cloud dashboard.

Before:

  • Messages appeared twice in history
  • First instance showed "_DashboardUI" as sender (incorrect)
  • Second instance showed correct logged-in username
  • "_DashboardUI" appeared in agent sidebar

After:

  • Single message per send
  • Messages show logged-in username
  • "_DashboardUI" hidden from sidebar

Root Cause

Optimistic messages created by frontend used logged-in username (e.g., "khaliqgant"), while server-confirmed messages used relay client name ("_DashboardUI"). The deduplication fingerprint included the 'from' field, causing mismatch and displaying both messages.

Changes

  1. Frontend Deduplication (useMessages.ts)

    • Changed fingerprint to match on to + content only
    • Excludes from field to handle server/client sender differences
  2. Backend Attribution (server.ts)

    • Added senderName to message data field in /api/send
    • Updated mapStoredMessages to use data.senderName for display when sender is _DashboardUI
  3. Sidebar Filtering (AgentList.tsx)

    • Explicitly filters out _DashboardUI from agent list

Test Plan

  • Send message from cloud dashboard
  • Verify single message appears (no duplicate)
  • Verify message shows logged-in username as sender
  • Verify "_DashboardUI" does not appear in sidebar
  • Verify other agents can reply to the actual user

🤖 Generated with Claude Code

Fixes issue where messages sent from cloud dashboard appeared twice:
once as "_DashboardUI" and once with correct username. Also removes
"_DashboardUI" from agent sidebar.

Root cause: Optimistic messages used logged-in username while server
messages used relay client name "_DashboardUI". Fingerprint mismatch
prevented deduplication.

Changes:
- Frontend deduplication now matches on to+content only (excludes from)
- Backend preserves senderName in message data field
- Display logic uses data.senderName for proper attribution
- AgentList filters out _DashboardUI from sidebar

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@my-senior-dev-pr-review
Copy link
Copy Markdown

🤖 My Senior Dev — Analysis Complete

👤 For @khaliqgant

📁 Expert in src/dashboard/react-components/ (9 edits) • ⚡ 41st PR this month

View your contributor analytics →


📊 3 files reviewed • 1 high risk • 4 need attention

🚨 High Risk:

  • src/dashboard-server/server.ts — Critical risks related to message sender information handling and possible confusion in message attribution.
  • src/dashboard/react-components/hooks/useMessages.ts — Critical logic changes that may cause significant deduplication issues leading to unintended message displays.

⚠️ Needs Attention:

  • src/dashboard-server/server.ts — Important changes in message attribution logic that could affect message handling across the application.
  • src/dashboard/react-components/AgentList.tsx — Improvement in maintainability and clarity of comments, though low severity overall.

🚀 Open Interactive Review →

The full interface unlocks features not available in GitHub:

  • 💬 AI Chat — Ask questions on any file, get context-aware answers
  • 🔍 Smart Hovers — See symbol definitions and usage without leaving the diff
  • 📚 Code Archeology — Understand how files evolved over time (/archeology)
  • 🎯 Learning Insights — See how this PR compares to similar changes

💬 Chat here: @my-senior-dev explain this change — or try @chaos-monkey @security-auditor @optimizer @skeptic @junior-dev

📖 View all 12 personas & slash commands

You can interact with me by mentioning @my-senior-dev in any comment:

In PR comments or on any line of code:

  • Ask questions about the code or PR
  • Request explanations of specific changes
  • Get suggestions for improvements

Slash commands:

  • /help — Show all available commands
  • /archeology — See the history and evolution of changed files
  • /profile — Performance analysis and suggestions
  • /expertise — Find who knows this code best
  • /personas — List all available AI personas

AI Personas (mention to get their perspective):

Persona Focus
@chaos-monkey 🐵 Edge cases & failure scenarios
@skeptic 🤨 Challenge assumptions
@optimizer Performance & efficiency
@security-auditor 🔒 Security vulnerabilities
@accessibility-advocate Inclusive design
@junior-dev 🌱 Simple explanations
@tech-debt-collector 💳 Code quality & shortcuts
@ux-champion 🎨 User experience
@devops-engineer 🚀 Deployment & scaling
@documentation-nazi 📚 Documentation gaps
@legacy-whisperer 🏛️ Working with existing code
@test-driven-purist Testing & TDD

For the best experience, view this PR on myseniordev.com — includes AI chat, file annotations, and interactive reviews.

@khaliqgant khaliqgant merged commit 62cb65e into main Jan 14, 2026
6 checks passed
@khaliqgant khaliqgant deleted the fix/cloud-dashboard-message-duplication branch January 14, 2026 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant