Skip to content

Prevent Buddy composer lag in long conversations #236

Description

@kiranfin

Description

Typing in the Buddy composer becomes noticeably delayed after a long conversation has accumulated.

Steps to Reproduce

  1. Open the Buddy.
  2. Continue the conversation until a large number of messages and actions are displayed.
  3. Type continuously in the composer.
  4. Compare the input responsiveness with a new or short conversation.

Expected Behavior

The composer remains responsive regardless of conversation length, and typing does not rerender the complete conversation history.

Actual Behavior

Input updates become increasingly delayed as the conversation grows.

Affected Component

Frontend

Environment

No response

Possible Cause

Confirmed by code review: the composer's draft state and the full messages array live in the same hook (useBuddyConversation.ts), whose return value is a new object on every render. That hook is instantiated once in BuddyProvider.tsx and passed straight into a React Context, so every keystroke produces a new context value and re-renders every consumer, including the full message list. Neither BuddyThread.tsx nor BuddyMessage.tsx is wrapped in React.memo (unlike the analogous chat feature's MessageRow, which is memoized specifically to isolate re-renders), and there is no list virtualization library in use. Fixing this means isolating composer/draft state from the message-list state (e.g. a separate context or a memoized message list) rather than profiling from scratch.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinguxImprovement for the user experience

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions