perf: Optimize messenger initialization #21642
Open
+39
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #21456
Summary
This PR integrates the optimizations coming from the status-go PR status-im/status-go#6106. Now messenger filters are set-up concurrently and we can call the endpoint
wakuext_chatsPreview
twice: once for non-community chats and once for community chats. This way, the user should be able to see some data render before the slow part ends (community-related data). All the hard work is in status-go and executed by @qfrankAreas that may be impacted
Steps to test
We need to check two cases for regression (functional and non-functional):
You login with a profile with many contacts, chats, opened/joined communities, notifications, etc. If you see all the data after login there's no functional regression.
Login with a profile with loads of data and roughly compare the time to see data arrive at different screens (contacts, opened/joined communities, etc) compared to
develop
. In theory, non-community data (e.g. 1:1 chats) can now arrive earlier and doesn't need to wait for the longer times to set-up filters related to community chats. Whichever call to status-go returns first will immediately trigger the client code to render the data.I already superficially tested both cases, but more extensive QA would be good.
status: ready