Skip to content

fix(react): handle network failure and prevent UI freeze in ChatInput - #1417

Open
yashsarvaiya45 wants to merge 1 commit into
RocketChat:developfrom
yashsarvaiya45:fix/chatinput-network-error-handling
Open

yashsarvaiya45 wants to merge 1 commit into
RocketChat:developfrom
yashsarvaiya45:fix/chatinput-network-error-handling

Conversation

@yashsarvaiya45

Copy link
Copy Markdown

Description

Fixes #1416

Added try...catch block around RCInstance.sendMessage in ChatInput.js. When a network failure, request timeout, or rejection occurs:

  • The pending optimistic message is cleaned up via removeMessage(pendingMessage._id).
  • An error toast is dispatched to alert the user instead of letting the message freeze indefinitely in the pending/grey state.

Testing

  • Tested local error simulation.
  • Verified that all linter checks pass cleanly (yarn lint).

This branch has not been deployed

No deployments
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.

Bug: Optimistic message permanently freezes in pending state on sendMessage network failure in ChatInput.js

1 participant