-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[🐛] Bug Report Title - Duplicate Messages While Resending Failed Messages #2852
Comments
This is my below code that I have implemented inside my
|
Hey @Vijay-Magadum, what's your stream-chat-react-native version? |
I am actually using |
hey @khushal87, have you found anything regarding this issue? |
Hey @Vijay-Magadum, we automatically handle the resend of the failed messages when clicking the resend button on the message actions when there are no network conditions, and when it recovers, so I don't think you need to do that from your side explicitly. Currently, we don't have a way to stop the behaviour but the default should work well for you. Did you face any issues with that? |
hey @khushal87, I have implemented a resend message logic for failed messages. When you tap on a failed message, it resends the message. However, if I have 8-9 failed messages and tap on them simultaneously to resend, I encounter an issue where duplicate messages are being sent. |
Instead of iterating through the failed messages like this:
Can you first filter out all the failed message and then iterate over only the failed messages to send them back? |
I have tried that as well but it was giving same error |
This is because when the connection recovers, we add the failed messages to the message list, and when you click on the button, it might add those duplicate copies as well. Can you rely on the resend button of the Message action for this and send individual messages one at a time? |
Our requirement was to send messages offline with a single tick, similar to WhatsApp, and have them automatically delivered to the other user when the device goes online. However, it seems this functionality is not currently supported in GetStream. As a result, we decided to implement automatic resending of failed messages when the device regains an internet connection. So is there any alternative way to achieve this? |
I can't think of any without any added customization to the SDK. Maybe you can track for which messages are already sent after you recover the internet and make sure it's not resent again somehow. Are there copies for all the failed messages in the chat or its only for a few of them? And do they persist after you refresh? |
Okay, I will check and get back to you. For failed messages, for example, if I send numbers 1 to 9 as individual messages and try to resend them automatically, the message order becomes random, and some messages are duplicated and they persist even after refresh. |
Interesting. We made some improvements in the behaviour of the message list in v6, but that upgrade would be a lot for you just to fix this issue, so I would not say that it might solve your problem. |
Okay, I will check that as well |
Hello,
I’ve implemented offline support in my app and am resending failed messages using the
retrySendMessage
function fromuseMessagesContext
. While it works, I’m seeing duplicate messages in the UI when navigating back and forth between the chat screen. However, the messages don’t have duplicate IDs in the dashboard.Can you help me figure out why this is happening?
Thanks!
As you can see the attached Image and the Error Below:
The text was updated successfully, but these errors were encountered: