Skip to content

fix(chat): prevent duplicate message keys on first chat welcome message#1002

Open
lc-soft wants to merge 1 commit intoRightNow-AI:mainfrom
lc-soft:fix/first-chat-bug
Open

fix(chat): prevent duplicate message keys on first chat welcome message#1002
lc-soft wants to merge 1 commit intoRightNow-AI:mainfrom
lc-soft:fix/first-chat-bug

Conversation

@lc-soft
Copy link
Copy Markdown
Contributor

@lc-soft lc-soft commented Apr 7, 2026

Summary

In the first chat session, the welcome message used a local id counter, while new user messages used the global message counter.

This could generate duplicate ids and cause key collisions in message list rendering, so the chat UI did not update correctly: both the new user message and assistant reply could be missing from the visible list until a page refresh.

screenshot-20260407-151254

Changes

Updated welcome message id generation to use the global message counter, preventing duplicate message ids.

Testing

  • cargo clippy --workspace --all-targets -- -D warnings passes
  • cargo test --workspace passes
  • Live integration tested (if applicable)

Security

  • No new unsafe code
  • No secrets or API keys in diff
  • User input validated at boundaries

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.

1 participant