RocketChat / EmbeddedChat

An easy to use full-stack component (ReactJS) embedding Rocket.Chat into your webapp
https://rocketchat.github.io/EmbeddedChat/docs
125 stars 251 forks source link

Proper Error Handling for "Message Too Long" #384

Closed Akshun-01 closed 8 months ago

Akshun-01 commented 10 months ago

Description:

In Embedded Chats, if the message is too long then it gives an error message of Error sending message, log in again. and logs the user out.

Getting logged out for sending long texts is a not very likely user experience, this should be properly handled with an Error message ( similar to what is done on RocketChat).

Steps to reproduce:

  1. Try to send a very long text or code.

Expected behavior:

image

Actual behavior:

Screencast from 01-02-2024 05:52:29 PM.webm

Akshun-01 commented 10 months ago

@abhinavkrin @sidmohanty11 Please confirm if this issue needs attention. I would love to start working on this.

rahat2134 commented 10 months ago

yup! I also want to work on this issue.

manascb1344 commented 10 months ago

Hey @abhinavkrin! 🚀 Just wanted to give you a heads up on the latest changes. Fixed the long message issue in the ChatInput component, now it shows a friendly error toast for character limit exceeded. Also added guidance to send long messages as attachments. No more unexpected logouts! Check it out and let me know if it's all good. 🙌 #384 ✨

Akshun-01 commented 10 months ago

Hey @sidmohanty11 @abhinavkrin, I have completed the modal and error handling. I am currently writing the code to change message to file and send it as an attachment. It is a bit tricky. So I just wanted to confirm before moving forward with this issue. Is this issue approved?

Will raise a draft soon! ^^

Akshun-01 commented 10 months ago

Update :

Hey, I have added the convert to file logic as well. Here is the current status.

https://github.com/RocketChat/EmbeddedChat/assets/93793691/1473487f-4f12-43d2-81d1-bc08805417b3

Some bugs need attention, I will try to fix them soon and send a PR (or should I send a draft pr, so you can also see the code changes ?)

[Any suggestions or feedback would be appreciated] @sidmohanty11

Spiral-Memory commented 9 months ago

Great find, @Akshun-01 , and great work fixing this as well.

Akshun-01 commented 8 months ago

Hello @abhinavkrin @sidmohanty11, resolved all the linting and conflicting issues. The changes are ready for review. Do take a look in your free time thanks! ✨