-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Login improvement #8306
Login improvement #8306
Conversation
@@ -6,7 +6,7 @@ import React | |||
@objc private var hasRegisteredLoad = false | |||
|
|||
deinit { | |||
DispatchQueue.main.async { | |||
DispatchQueue.main.sync { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change fixes a crash when reloading the app in dev mode.
@@ -60,7 +60,7 @@ class NetworkManager { | |||
sessionConfiguration: { | |||
allowsCellularAccess: true, | |||
waitsForConnectivity: false, | |||
httpMaximumConnectionsPerHost: 10, | |||
httpMaximumConnectionsPerHost: 100, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change increases the amount of concurrent requests that can be perform for each server, specially significant on Android
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just some minor comments.
@rahimrahman how are we with the review? |
Cherry pick is scheduled. |
* refactor to improve requests on login * include in team sidebar order by display name teams not present in the order preference * Fix iOS reload while developing * fix code causing tests to fail * feedback review * update network-client (cherry picked from commit ea2cb45)
* refactor to improve requests on login * include in team sidebar order by display name teams not present in the order preference * Fix iOS reload while developing * fix code causing tests to fail * feedback review * update network-client (cherry picked from commit ea2cb45) Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
Summary
Currently signing in into a server that has many teams and threads can take a long time, this was mostly because of some
await
calls in the entry actions, specially around fetching the threads for teams.So in this PR we are refactoring the code a bit, first to defer some of the actions by pushing them to another event loop as well as changing some code to optimize certain things. Also in addition we introduced mattermost/mattermost#29042 so that we don't need to fetch the DM / GM threads for every team at start time as they are the same for every team and we can leave that sync to an on demand kind of scenario.
Note: This PR needs updating once mattermost/react-native-network-client#134 has been merged and released.
Ticket Link
Part of https://mattermost.atlassian.net/browse/MM-58384
Checklist
Environment
This PR was tested on a server with a user that belongs to 85 teams with hundreds of channels
Release Note