Preserve message content when chat send fails#605
Conversation
When users try to send a message while disconnected from the chat, the message was being cleared even though it failed to send. This was because handleSendMessage returned early without throwing an error, so the .then() block in MessageInput executed and cleared the input. Now handleSendMessage throws an error when not connected, which is caught by MessageInput's error handler, preserving the user's message in the input box so they don't lose their typed content. https://claude.ai/code/session_012EqUZa3tCdhg3hHkBQkDdg
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
When users try to send a message while disconnected from the chat,
the message was being cleared even though it failed to send. This was
because handleSendMessage returned early without throwing an error,
so the .then() block in MessageInput executed and cleared the input.
Now handleSendMessage throws an error when not connected, which is
caught by MessageInput's error handler, preserving the user's message
in the input box so they don't lose their typed content.
https://claude.ai/code/session_012EqUZa3tCdhg3hHkBQkDdg
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.