Chat messages disappearing until pull torefresh or app kill
Chat messages in any thread first appears when you send it, but if you go back and go back into chat that message is not there.
Noticed same issue
I can't replicate this. Just to confirm:
- Open 1-to-1 thread
- Send text message
- Message appears
- Click back
- Re-open thread
After doing this, I see the message as expected. If you are seeing something different, can you give me exact steps to reproduce the issue?
Yes, I can confirm that these are exact steps I take to reproduce it. I also noticed t hat after step 3 if you wait some time (not long, lets say approx 30 sec or a 60sec) it will stay when you come back.
Maybe this will shed some light on that: when I write a message and go back I also see that I have new message from myself in that chat and I can see it as "lastMessage" under the username, but when I go in I cannot see it unless I wait sometime. Some kind of sync happens
P.S.
This happens in any chat 1-to-1, group & public
I can't replicate this issue. Does it happen on default version of the ChatSDK from Github with no modification? If so, can you give me details of the hardware you're using and the Android device?
I did compile new fresh version from Github with one slight modification, but its styling issue (app crashing when inflating view) problem still happens every time I send a message, it happens in every chat, always.
Android version 6.0.1 hardware: samsung note 4 it also happens to my friends phone which is one plus 3
I could attach video if that would help
Can you attach a video?
Hi,
here is a video showing that when I write a message in group or 1-to-1 chat they do not appear there. this is not modified version except the tabs style thing, so it would compile
https://www.dropbox.com/s/7432hvmagq3svft/2017_11_13_13_57_26.mp4?dl=0
I can't reproduce this. Does it happen with the completely non-modified version? Are there any exceptions thrown in the logs?
yes, it also happens when i install demo apk that you built
and to add more, it happens everytime for every message. not that it happens sometimes. in other words I have not been avle to send a message properly yet
And it happens when you checkout the project and compile? Are there any exceptions? Have you tried using the latest version? There have been updates recently.
hi, #188 explains why it happens, my clock was one minute off and thats why it was happening. Another question is: why it still shows me a new message is in the chat when I wrote it myself?
The Chat is designed to mark messages from yourself as read immediately.
Is it showing the message when you send a message and quickly leave the chat or when you send a message and it updates correctly? It has been known to occur in the first instance but shouldn't with the second
For me it happens each time.
- I write a message
- wait around for 5-10 sec, press back and it shows me as unread
- go to a different chat room, do the same thing, press back
- now the old "unread" is gone, but new message took over and is unread
I'm facing the same issue. And also after full reinstall unread messages counter displays all messages from chat (mine and not mine) as unread until I open chat. For that counter I use folowing snippet:
Thread currentThread = StorageManager.shared().fetchThreadWithEntityID(mCurrentChatId);
int unreadCount = 0;
if (currentThread != null) {
unreadCount = currentThread.getUnreadMessagesCount();
}
I'd like to contribute from my long experience with Google App Engine and Datastore. After talking to the App Engine developers, these were the conclusions:
The app engine server is not a single server. It is many connected machines. The "server timestamp" may vary by machine. Note that the variation may be dependent on the user's location, which may explain why the issue always shows for e.g. @jagas, @Yariko-chan but not for you.
The solution: Always read a little bit into the past. The Google app server engineers suggested that 12 seconds should be safe. Make sure you deal with duplicate and with "past" messages correctly on the client.
Just my 2 cents... :)
@OferRnz Thanks for your comment. I double checked the code and I don't think that the timestamp should cause a problem. What happens in the code is that when the app starts, a listener is added which listens for any messages that have arrived since the last message. If there were an issue with the timestamp, we would expect the app to work correctly after 12 had passed (even if it didn't handle messages that had been sent within 12 seconds of the last message).
I did manage to replicate an issue which is similar to this. To replicate the issue:
- Open the chat view
- Put the app in the background
- Send a message to the app from a different device
- Re-open the app. The message will be absent from the list.
This has now been fixed and will be available in the next Gradle release - 4.0.9. For the time being I'm closing this issue because I've not been able to replicate it. If it continues, please reopen the issue.