Implement a mechanism to handle cases where a chat message fails to send due to network issues, disconnection, timeout, or any other error, in order to prevent message loss and improve the user experience.
Requirements:
- Detect when a message fails to send
- Display a clear message status, such as: sent / sending / failed
- Allow retrying a failed message
- Temporarily preserve the message until it is successfully sent
- Prevent duplicate sending of the same message
- Handle cases of no internet connection or temporary server issues
- Automatically update the message status once sending succeeds
Implement a mechanism to handle cases where a chat message fails to send due to network issues, disconnection, timeout, or any other error, in order to prevent message loss and improve the user experience.
Requirements: