Skip to content

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

Merged
Aryan-Verma-999 merged 1 commit into
RocketChat:developfrom
yashsarvaiya45:fix/chatinput-network-error-handling
Nov 15, 2026
Merged

Aryan-Verma-999 merged 1 commit into
RocketChat:developfrom
yashsarvaiya45:fix/chatinput-network-error-handling

Conversation

@yashsarvaiya45

Copy link
Copy Markdown
Contributor

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).

@Aryan-Verma-999

Copy link
Copy Markdown
Collaborator

LGTM, Thanks for the contribution :)

@Aryan-Verma-999
Aryan-Verma-999 merged commit 11d18a3 into RocketChat:develop Nov 15, 2026
4 checks passed
github-actions Bot added a commit that referenced this pull request Nov 15, 2026
@yashsarvaiya45
yashsarvaiya45 deleted the fix/chatinput-network-error-handling branch November 15, 2026 10:35
@yashsarvaiya45

Copy link
Copy Markdown
Contributor Author

Thanks for reviewing and merging @Aryan-Verma-999!

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

2 participants