Skip to content

Commit

Permalink
correct the TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamadJaara committed Dec 23, 2024
1 parent cda263c commit 1a60cb1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,13 @@ internal class UserDataSource internal constructor(
private suspend fun updateSelfUserProviderAccountInfo(userDTO: SelfUserDTO): Either<StorageFailure, Unit> =
sessionRepository.updateSsoIdAndScimInfo(userDTO.id.toModel(), idMapper.toSsoId(userDTO.ssoID), userDTO.managedByDTO)

// TODO: race condition, if we request the same user (can happen for self) multiple times, we will fetch it multiple times
override suspend fun getKnownUser(userId: UserId): Flow<OtherUser?> =
userDAO.observeUserDetailsByQualifiedID(qualifiedID = userId.toDao())
.map { userEntity ->
userEntity?.let { userMapper.fromUserDetailsEntityToOtherUser(userEntity) }
}.onEach { otherUser ->
if (otherUser != null) {
// TODO: reuse TCP connection aka update in parallel
refreshUserDetailsIfNeeded(userId)
}
}
Expand Down

0 comments on commit 1a60cb1

Please sign in to comment.