-
Notifications
You must be signed in to change notification settings - Fork 291
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
feat: Store user's metadata in database [FS-1828] #15002
Conversation
0099148
to
a099350
Compare
a099350
to
851bc4e
Compare
const {members: teamMembers} = await teamRepository.initTeam(selfUser.teamId); | ||
telemetry.timeStep(AppInitTimingsStep.RECEIVED_USER_DATA); | ||
|
||
const connections = await connectionRepository.getConnections(); | ||
telemetry.addStatistic(AppInitStatisticsValue.CONNECTIONS, connections.length, 50); | ||
|
||
await userRepository.loadUsers(connections, [...teamMembers, selfUser.qualifiedId]); |
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 is the major change here. Now getConnections
and initTeam
do not fetch user's metadata anymore (doing less side-effects).
Instead they return the userIds that needs to be loaded later on
The userRepository.loadUsers
is responsible for loading the users from the DB and fetch the missing users on backend
Codecov Report
@@ Coverage Diff @@
## dev #15002 +/- ##
==========================================
+ Coverage 43.12% 43.29% +0.16%
==========================================
Files 641 642 +1
Lines 21545 21543 -2
Branches 4935 4932 -3
==========================================
+ Hits 9292 9327 +35
+ Misses 11066 11029 -37
Partials 1187 1187 |
This will make sure that we download a user only once.
websocket
user.update
message), we update the in-memory user and the database entryThis will: