🔧 MESSAGE DEDUPLICATION: Eliminate double rendering when second user sends messages ## Root Cause Analysis: Messages from other users were being processed by multiple event handlers: 1. Regular 'message' event handler 2. Goose message detection (heuristic) 3. Session message handler This caused the same message to appear multiple times in the chat. ## Solution Implementation: ### Enhanced Message Classification: ✅ Added message type flags (isGooseMessage, isSessionMessage) ✅ Use else-if chain to ensure only one handler processes each message ✅ Prevent multiple event emissions for the same message ### Smart Event Routing: ✅ Regular messages: Only emit 'message' if not Goose/session message ✅ Goose messages: Emit 'gooseMessage' + special 'gooseSessionSync' for collaboration ✅ Session messages: Emit 'sessionMessage' for legacy session handling ✅ Structured logging to track which handler processes each message ### Enhanced Matrix Context: ✅ Updated onMessage to support both default and named event listeners ✅ Overloaded function signature for backward compatibility ✅ Support for 'gooseSessionSync' event in useSessionSharing ### Session Sharing Integration: ✅ Added listener for 'gooseSessionSync' events ✅ Proper cleanup for all event listeners ✅ Maintains existing functionality while preventing duplicates ## Technical Flow: 1. Message received → Classify as regular/Goose/session 2. Emit appropriate event(s) → Only one primary handler per message 3. UI renders once → No duplicate message components 4. Collaboration sync → Works via dedicated 'gooseSessionSync' event ## Benefits: 🎯 **No More Duplicates**: Each message renders exactly once 🔄 **Preserved Functionality**: All existing features still work 🦆 **Goose Communication**: Still detects and handles Goose messages 📝 **Session Sync**: Collaborative sessions work without duplicates 🧹 **Clean Logging**: Clear indication of message processing path Now when a second user sends a message in a collaborative session, it will appear exactly once with the correct sender avatar! 🦆✨
🎉 Hacktoberfest 2025 🎉
goose is a participating project in Hacktoberfest 2025! We’re so excited for your contributions, and have created a wide variety of issues so that anyone can contribute. Whether you're a seasoned developer or a first-time open source contributor, there's something for everyone.
To get started:
- Read the contributing guide.
- Read the code of conduct.
- Read the full Responsible AI-Assisted Coding Guide.
- Choose a task from this project's Hacktoberfest issues in our Project Hub and follow the instructions. Each issue has the 🏷️
hacktoberfestlabel.
Have questions? Connecting with us in our Discord community in the #hacktoberfest project channel.
goose is your on-machine AI agent, capable of automating complex development tasks from start to finish. More than just code suggestions, goose can build entire projects from scratch, write and execute code, debug failures, orchestrate workflows, and interact with external APIs - autonomously.
Whether you're prototyping an idea, refining existing code, or managing intricate engineering pipelines, goose adapts to your workflow and executes tasks with precision.
Designed for maximum flexibility, goose works with any LLM and supports multi-model configuration to optimize performance and cost, seamlessly integrates with MCP servers, and is available as both a desktop app as well as CLI - making it the ultimate AI assistant for developers who want to move faster and focus on innovation.
Quick Links
a little goose humor 🦢
Why did the developer choose goose as their AI agent?
Because it always helps them "migrate" their code to production! 🚀