Skip to content

When there is an ongoing AI streaming, switch the chat id, will cause data overwrite. #696

Closed
@daimajia

Description

@daimajia

Description

When there is an ongoing AI streaming, switching the chat ID and causing a re-render of useChat can lead to some abnormal situations.

The data from the ongoing AI stream will overwrite the data of the newly switched chat ID.

Code example

<ParentComponent /> (useChat)
      <FirstChild  messages={messages} />
     <Button>Swtich Chat ID</Button>
<SecondChild /> 

Additional context

All client components, and all the data have been fully loaded on client.
No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai/uibugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions