status-desktop icon indicating copy to clipboard operation
status-desktop copied to clipboard

Group chat disappeared but notifications still came in

Open jrainville opened this issue 3 years ago • 12 comments

Bug Report

Description

Very weird bug that happened to me and Rick.

I opened the app and everything looked normal, but then I started seeing notifications come in for new messages (both OS and ephemeral depending on the focus state of the app), but none of my channel or communities showed the badge for new messages. I checked my muted channels just in case, and it wasn't that either.

Turns out, one of my private group chats just disappeared from the list. I could not see it at all, but I could still receive the messages and notifications. So the signals from status-go worked.

This means the issue is either in Nim or QML.

Closing and reopening didn't fix it.

We could fix it by kicking me out of the group and re-adding me. Then I could see the group and even the old messages.

Steps to reproduce

No idea. It happened seemingly randomly

Additional Information

  • Status desktop version: 0.8.1
  • Operating System: Ubuntu 20

jrainville avatar Dec 13 '22 19:12 jrainville

Moving to 0.10, because it needs a bigger change, since it's related to the way our group chats behave. Since we auto accept group chats from mutal contacts, but NOT from non-mutual contacts, if the person that propagates the chat is a non-contact, it will not be set as active. To fix this, we'll probably show it in the AC as is done on mobile. We'll get designs in January.

jrainville avatar Dec 19 '22 18:12 jrainville

Part of this has been fixed here https://github.com/status-im/status-go/pull/3037 With the above PR, if you still have your contacts intact or partially, the group chat should reappear, because we check if the owner is a mutual contact. We still need the activity center notifications for the case where your contacts are gone though.

jrainville avatar Jan 05 '23 19:01 jrainville

@MishkaRogachev for this task, what we need is a AC notification that says that we have been added to a group but the owner is not our contact.

The user is not our contact usually because we re-synced our app and we lost our contacts, but we still receive the chat when someone chats in it. It could also happen if someone tries to spam us, but the AC would still act as a blocker.

Clicking Accept (checkmark) adds the group chat to our chats. Clicking Dismiss (X) removes the AC notification and the chat stays hidden and we also don't setup filters for it.

jrainville avatar Nov 16 '23 15:11 jrainville

I studied how group chats used to work and why we decided to automatically add to group chats. The thing is that if we allow the possibility to join a group chat by invitation from a non-mutual contact, then such a chat will simply not work.

However, there is a problem if we create an account with a public key that is already in a group chat or if we synchronize a new device: the invitation may come before we add (or synchronize) the necessary contact.

What can be done? Add such a contact not explicitly or vice versa, when adding a contact additionally request groups where the current user and the contact - the admin of this group are present.

@osmaczko @iurimatias

MishkaRogachev avatar Dec 04 '23 09:12 MishkaRogachev

However, there is a problem if we create an account with a public key that is already in a group chat or if we synchronize a new device: the invitation may come before we add (or synchronize) the necessary contact.

If we synchronize a new device or restore from backup, shouldn't we simply trust it and recreate group chat regardless if invitation was from not yet synchronized contact?

osmaczko avatar Dec 04 '23 10:12 osmaczko

If we synchronize a new device or restore from backup, shouldn't we simply trust it and recreate group chat regardless if invitation was from not yet synchronized contact?

it might work, but it only solves one case out of two.

MishkaRogachev avatar Dec 04 '23 11:12 MishkaRogachev

UPD: the possibility to create a new account based on the same seed phrase is a hack, which is not quite clear how to prohibit. Using this approach is fraught with a number of problems and is not directly related to this task.

Here we need to make the following fix: do not check a contact when restoring a group chat from backup

MishkaRogachev avatar Dec 05 '23 10:12 MishkaRogachev

Сurrent status:

Group chats are restored normally on successful restore from backup or synchronization. We don't use the function we suspected when restoring, but use this one and i can confirm that it works well.

There is still a problem if the restore is not successful, but in this case the whole application is barely working and as far as we can't prohibit users from doing that we need to analyse/discuss how to minimise the damage.

MishkaRogachev avatar Jan 29 '24 14:01 MishkaRogachev

It seems like this issue is mostly fixed.

However, I think there is still one scenario that would cause the problem:

A user re-imports their account and somehow nothing gets fetched, for whatever reason (no store nodes, account is too old, user selected the wrong option ie I am new to Status).

Then, they won't have their contacts and if they were in a group chat with other users, the group chat will not appear when a new message is sent, because it doesn't come from mutual contact.

Maybe it just doesn't show and it looks normal, but back when the issue happened to me, I would still receive a notification, which was super confusing.

So @MishkaRogachev , can you test if that scenario still happens?

If so, what we need to do is show the group "invite" in the AC when we receive that message. That way, the user can know that they received something and rejoin. Then they'll be able to re-add the others as contacts for example.

We need the AC and not just auto-join, because we want to mitigate spam.

jrainville avatar Feb 09 '24 14:02 jrainville

A user re-imports their account and somehow nothing gets fetched, for whatever reason (no store nodes, account is too old, user selected the wrong option ie I am new to Status).

@jrainville yes, in this scenario it may happen i have already reproduced it. But this problem is the tip of the iceberg, if recovery is not successful not only group chats and contact requests (and I suspect many other things with shared state) are not working correctly.

And I checked with @saledjenic, there is no technical way to limit this right now.

Here I think we need to decide, if the application should function normally under this scenario, it is worth changing many flows

MishkaRogachev avatar Feb 09 '24 15:02 MishkaRogachev

if recovery is not successful not only group chats and contact requests (and I suspect many other things with shared state) are not working correctly.

In theory, the account is still a functioning account after an import with no fetched back up. Of course, you'll need to re-add people to your contacts and rejoin communities, but I wouldn't say the account is broken beyond repair.

This scenario I outlined is one that can happen and is very bad. First, it's confusing, but also it completely blocks the use of that group chat. The only way to fix it right now from a user's perspective is to add back the people in the group chat, then get kicked from the group and re-added. This is not something that's intuitive.

So having the AC notification about the group is the best way to manage this. It also aligns with mobile (at lest they had that last year).

Here I think we need to decide, if the application should function normally under this scenario, it is worth changing many flows

Yes, we want to support an account recovered with no backups. And no, we don't need to change many flows, just the one with the AC notification for a new group chat received form a non-contact.

jrainville avatar Feb 09 '24 15:02 jrainville

moving to 2.29 due to lack of space in this milestone

iurimatias avatar Mar 01 '24 19:03 iurimatias

@xAlisher we do not have an existing notification that we were added to the group from an unknown contact Could you please provide a design for such a notification Here's how it looks like on mobile

E78763B0-1087-4515-957F-86A3E5DCC5AF_1_105_c

mprakhov avatar Apr 10 '24 11:04 mprakhov