Skip to content

Conversation

@vivekyadav-3
Copy link

While exploring the
ChatInput
component, I noticed that quoting multiple messages led to redundant content accumulation in the message body. This was caused by a string mutation inside the quoteMessage.map loop.

I've refactored the logic to use a clean functional approach (map + join), which ensures each quote correctly generates exactly one link and improves performance

Copilot AI review requested due to automatic review settings January 24, 2026 13:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where quoting multiple messages in ChatInput resulted in duplicated links. The issue was caused by mutating a shared quotedMessages variable inside the map loop, causing accumulation across iterations.

Changes:

  • Refactored quote message handling to use a functional approach with map returning individual links instead of mutating shared state
  • Renamed quoteArray to quoteLinks for better clarity
  • Each quote now generates exactly one link, preventing duplication

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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