Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent the 'Message' components from unexpectedly re-rendering while receiving tokens #1051

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Jun 3, 2024

  1. Fix a problem which will cause unexpected rerendering while receiving…

    … tokens
    
    While receiving tokens from the server, the  'updateMessageContentById' function will create new objects for all the messages having 'steps' member, which will modify the references value of the messages and cause all the 'Message' components based on those messages to rerender. If we have a long conversations, like 100 rounds, this may cause serious performance problem.
    
    This patch tried to fix it by checking if the messages really changed and only creating new objects for changed ones.
    
    Meanwhile, given that only one message need to be updated and for most of the cases the last one, this patch also make some performance optimization by iterating from the last element and break the loop when finding matched one.
    0xez authored Jun 3, 2024
    Configuration menu
    Copy the full SHA
    79d3f7c View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2024

  1. Configuration menu
    Copy the full SHA
    6939314 View commit details
    Browse the repository at this point in the history