Skip to content

fix: add user-friendly error notification for login failures#1107

Merged
Spiral-Memory merged 1 commit intoRocketChat:developfrom
vivekyadav-3:fix/login-error-notification
Mar 21, 2026
Merged

fix: add user-friendly error notification for login failures#1107
Spiral-Memory merged 1 commit intoRocketChat:developfrom
vivekyadav-3:fix/login-error-notification

Conversation

@vivekyadav-3
Copy link
Contributor

Problem
Currently, when login fails due to network errors or unexpected server issues, users receive no feedback. The error is only logged to the console, leaving users confused about why login isn't working.

Solution
Added a user-friendly toast notification that appears when login fails unexpectedly. This provides clear feedback to users that there's a connection issue and suggests checking their network.

Changes

  • Enhanced error handling in useRCAuth.js hook
  • Added toast notification using existing dispatchToastMessage utility
  • Fixed typo: "A error" → "An error"

Testing

  • Build passes successfully
  • Uses existing toast infrastructure (no new dependencies)
  • Maintains existing error logging for debugging

User Impact
Users will now see: "Unable to connect to server. Please check your connection and try again." instead of being left wondering why login failed.

Copilot AI review requested due to automatic review settings January 25, 2026 16:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the login UX by surfacing a clear, user-friendly error notification when login fails unexpectedly (e.g., network/server issues), instead of only logging to the console.

Changes:

  • Corrected the console error message grammar from "A error occurred..." to "An error occurred..." in the useRCAuth hook.
  • Added an error toast in the useRCAuth login catch block using the existing dispatchToastMessage utility, with the message: "Unable to connect to server. Please check your connection and try again."
  • Kept existing console logging for debugging while ensuring end users receive visible feedback on connection/login issues.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@Spiral-Memory Spiral-Memory left a comment

Choose a reason for hiding this comment

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

LGTM

@Spiral-Memory Spiral-Memory added the chore a subtle fix label Mar 21, 2026
@Spiral-Memory Spiral-Memory merged commit 97fc430 into RocketChat:develop Mar 21, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore a subtle fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants