Skip to content

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

Merged
jaberjaber23 merged 1 commit intoRightNow-AI:mainfrom
lc-soft:fix/first-chat-bug
Apr 10, 2026
Merged

fix(chat): prevent duplicate message keys on first chat welcome message#1002
jaberjaber23 merged 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

Copy link
Copy Markdown
Member

@jaberjaber23 jaberjaber23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Local counter shadowed the global msgId, causing duplicate keys and rendering bugs on first chat.

@jaberjaber23 jaberjaber23 merged commit 4a8af88 into RightNow-AI:main Apr 10, 2026
2 of 11 checks passed
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