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

Dogusata/fix update chat answer with message id not working #50

Merged
merged 3 commits into from
May 24, 2024

Conversation

dogusata
Copy link
Collaborator

Problem

To update a chat card, if it is/was the latest streaming card, it can be updated with updateLastChatItem method. For all other cases updateChatItemWithMessageId should work. However, if there is no streaming card at all in the whole window, cards are not getting updated with both of the functions.

Expected Behaviour:

Doesn't matter what type is the chat item and it is the last of not, it has to be updated with updateChatItemWithMessageId if the chat item with the given messageId is rendered already.

Steps to Reproduce:

Create a card by adding a new ChatItem with type ANSWER without providing the body attribute. After that try to update it with any of the mentioned methods above.

Solution

The checks for adding a card render to the rendered items list was insufficient. Any card (if they are rendered) should be added to the rendered items list to allow them to be updated. Previously the UX decision was to not update the cards after they finish the streaming. However for cases like WeaverBird's file rejection and reverting rejects, previous cards should also allow updating.

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@dogusata dogusata requested a review from a team as a code owner May 24, 2024 09:14
example/src/main.ts Outdated Show resolved Hide resolved
@dogusata dogusata merged commit 9994ed2 into main May 24, 2024
1 check passed
@dogusata dogusata deleted the dogusata/fix-updateChatAnswerWithMessageId-not-working branch May 24, 2024 09:41
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.

2 participants