Chats with different content displayed separately on Recent list for the same contact/account (#75)
Closed
Artur Hefczyc opened 7 years ago

I noticed that the client displays 2 separate chats for the same contact/account combination but each chat is with a different content. What's more, one of the chats contains message correctly pushed when the client was offline, another chat contains only message which was not pushed when the client was offline.

I am not 100% sure about this as this is very difficult to test and actually know for sure, since the client does not display resource name of the contact but my suspicion is that each of these chats could have different resources combination for contact/account. However, is pure speculation at this point.

It might be also related to the problem reported elsewhere with roster updates and susbscription not populated across all cluster nodes.

fullsizeoutput_db01.jpeg fullsizeoutput_db22.jpeg fullsizeoutput_db23.jpeg

Andrzej Wójcik (Tigase) commented 7 years ago

%kobit

I'm a little confused here as this should not happen. If one chat exists with (@account@, @contacts bare jid@) pair, then a new one should not be created. I've tested it just now and it works fine. The only issue I can see is that in theory, it could be possible that there was a race condition which would create 2 entries.

As for displaying 2 records for same (account, jid) pair but with different content, then I must say that this is impossible. Data are loaded from the database using a select query with parameters which takes only account (bare jid) and contact (bare jid).

To be honest I do not see any example that would confirm that there are 2 entries with 2 different contents (messages).

As for message pushes - those messages are not stored in a database at all. So if they are not stored, they do not open a new chat so it is impossible for them to create a second entry or be listed separately in the chat list. These push notifications are used only to create notifications in iOS notification center and to count them and present in the application badge.

My guess here is that #6100 and this bug report are actually the same and most likely caused by the same race condition issue in which case 2 entries are created in chats list but when a new message is received or contact presence is changed then only single entry is updated in a displayed list.

I will focus on solving this possible race condition issue as fixing it will solve issue with displaying second entry with old values as well.

Should I provide a code to remove duplicated entries? If you would close one of those duplicated chats (or best close both of them and then reopen) then this should fix issue (you will get single entry).

And one more question is it possible that these entries were created once you entered chats from notification? (Tap on notification in iOS notification center).

Artur Hefczyc commented 7 years ago

Still happens. The only idea I have at the moment that, maybe one of the chats was created before adding contact to the roster/exchanging subscription and the second could have been created after adding contact to the roster. Does it make sense?

I am attaching screenshots to show how it looks like on both devices.

  1. The first shows chat list on the first device with 2 chats marked which are for the same contact (and for the same account). As you can see I sent slightly different message from each chat

  2. The second screenshot shows the chat window on the other device with both messages received and a response I have just sent

  3. The third screenshot shows again, my first device with these 2 chats marked and response in one of them.

Artur Hefczyc commented 7 years ago

This is not a critical issue. If you have no quick solution and it requires more time, leave it for next version.

Andrzej Wójcik (Tigase) commented 7 years ago

It took me a while before I've understood what happened here.

At first, I wanted to answer for:

The only idea I have at the moment that, maybe one of the chats was created before adding contact to the roster/exchanging subscription and the second could have been created after adding contact to the roster. Does it make sense?

This does not make sense. How would it impact chats if I'm using account and bare jid to look up for chats and messages?

But I've decided to look at our MAM archive, directly in the database to understand what is going on. And I've found out that the only difference between this two messages is that

one of them is sent to jid starting with J and the second to jid starting with @j@. So the issue here is that our client is case sensitive on the database layer when you compare jids and I need to fix it.

Andrzej Wójcik (Tigase) commented 7 years ago

%kobit I was able to fix this issue, but changes were rather large as I need to update the database schema.

However, during testing, I've found an issue (#6130) which I need to fix before I will release next build. I hope to fix it today or tomorrow and then release a next build.

Artur Hefczyc commented 7 years ago

You have not assigned the ticket to me but I can confirm now that the problem is fixed in build 2.0b13.

issue 1 of 1
Type
Bug
Priority
Normal
Assignee
RedmineID
6101
Version
Version 2.0
Issue Votes (0)
Watchers (0)
Reference
tigase/_clients/siskin-im#75
Please wait...
Page is in error, reload to recover