Skip to content

Add updateMessage handler on ThreadStorage#790

Open
AbhinRustagi wants to merge 15 commits into
mainfrom
TH-2025
Open

Add updateMessage handler on ThreadStorage#790
AbhinRustagi wants to merge 15 commits into
mainfrom
TH-2025

Conversation

@AbhinRustagi

@AbhinRustagi AbhinRustagi commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What

Fixes TH-2025.

  1. Updated the docs to mention the new updateMessage method on the ThreadStorage interface.
  2. Added a replaceMessageId on processStreamedMessage which earlier generated a client-side UUID for each message for the render session. However, it does not replace it with the server-side generated ID until the data is restored from the API. Because of that, during render, a updateMessage would result in a 404 since the message IDs don't match. The function replaces the ID during streaming as soon as the TEXT_MESSAGE_START event is received which carries the server generated message ID.
  3. Added a ref check in GenUIAssistantMessage.tsx which would check if the last persisted message matches the current and avoids refiring the updateMessage flow since the onStateUpdate is called by the function itself and by store subscription as well).

Checklist

  • I linked a related issue, if applicable
  • I updated docs/README when needed
  • I considered backwards compatibility

@AbhinRustagi
AbhinRustagi marked this pull request as ready for review July 20, 2026 20:18
abhithesys
abhithesys previously approved these changes Jul 22, 2026
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