Skip to content
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

Improve order of synced chats #12783

Closed
cammellos opened this issue Nov 2, 2021 · 12 comments
Closed

Improve order of synced chats #12783

cammellos opened this issue Nov 2, 2021 · 12 comments
Assignees
Labels
feature feature requests
Milestone

Comments

@cammellos
Copy link
Contributor

As a user
I want to have chat synced in order
So that the most relevant messages are received in a shorted time interval

Description

Currently once a user goes back online, we fetch all the topics for all the chats in one go.
We should improve the way syncing works by being selective on which chat to sync first.

In order of importance we should sync:

  1. The chat the user is in when opening the chat, depends on Re-open app on the last open chat #12782
  2. Last community channel the user was in
  3. Fetch messages from all community channels the user has visited in the past 7 days
  4. Fetch all 1-to-1 and ad-hoc group chats
  5. Fetch messages from all community channels the user has not visited in the past 7 days
  6. Fetch public unmoderated group chats (with the understanding that this 5th step will be removed as soon as we remove public unmoderated group chats from the product)

Considerations

Some of these only make sense if the interval we are syncing is large enough (1 seems to be almost always a good choice, but after that we probably want to make sure it's worth the overhead, i.e if you are syncing 2 minutes of data, is most likely better to just sync everything in one go, as opposed if you are syncing a couple of hours).

The goal of this issue is to improve syncing, to bring the most relevant messages to the user as quickly as possible, so we should re-evaluate as we go along that it is indeed making things faster, and tests need to be performed with a device with many chats/contacts.

@cammellos cammellos added the feature feature requests label Nov 2, 2021
@cammellos cammellos added this to the Release 1.19 milestone Nov 30, 2021
@hesterbruikman
Copy link
Contributor

@cammellos not sure how the members list works exactly. Are updates send to a dedicated topic for online status updates? If so, we'd need to discuss where it sits in the fetching priority list (cc @simonricoo )

@rasom rasom self-assigned this Jan 20, 2022
@rasom
Copy link
Contributor

rasom commented Jan 21, 2022

With ~40 pub chats (those which contain spam) after 1h offline it took 40s for 1-1 message be to received after opening chat's screen (that was the last opened chat, so it was opened right after login).

@rasom
Copy link
Contributor

rasom commented Jan 21, 2022

1h, [42 4 15 18 7 12 5 7 9 15], avg=13.4
But on average it is not that bad, I will repeat tests with longer offline period.

@rasom
Copy link
Contributor

rasom commented Jan 22, 2022

24h, [32 10 25 23 29 27 28 34 30 13], avg=25.1
It gets worse.

@rasom
Copy link
Contributor

rasom commented Jan 24, 2022

After three days I just stopped receiving messages in that 1-1. Even if I send new ones, they are not received. Also not all outgoing messages were received on the other side, but idk whether that's because of mailservers. Basically 1-1 chat is broken.

@cammellos
Copy link
Contributor Author

@rasom could you get geth.log please? and maybe keep the account so we can debug

@rasom
Copy link
Contributor

rasom commented Jan 24, 2022

@cammellos sure

@rasom
Copy link
Contributor

rasom commented Jan 24, 2022

btw all 1-1 chats and private groups stopped working. I tried to add that account to a private group or to a new 1-1 chat and messages were not received. Pubchats work as expected.

@rasom
Copy link
Contributor

rasom commented Jan 24, 2022

@cammellos https://gist.github.com/rasom/4f38aa50cd54dafe99a3b2d42cea1dc3

should I run it with debug level?

@cammellos
Copy link
Contributor Author

@rasom not for now, I will ask you for more

@cammellos
Copy link
Contributor Author

@rasom this can be closed for now?
we can re-open if further optimization is necessary, what do you think?

@rasom
Copy link
Contributor

rasom commented Feb 28, 2022

@cammellos agree

@rasom rasom closed this as completed Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature feature requests
Projects
None yet
Development

No branches or pull requests

3 participants