Skip to content

Commit

Permalink
Merge pull request #1270 from lowcoder-org/fix/db_concurrency
Browse files Browse the repository at this point in the history
mongodb concurrency issue fixed
  • Loading branch information
FalkWolsky authored Oct 30, 2024
2 parents bdd356b + 498727e commit d895281
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public interface UserService {

Mono<User> addNewConnectionAndReturnUser(String userId, AuthUser authUser);

Mono<User> saveUser(User user);

Mono<Void> deleteProfilePhoto(User visitor);

Mono<Boolean> updatePassword(String userId, String oldPassword, String newPassword);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ public Mono<User> addNewConnectionAndReturnUser(String userId, AuthUser authUser
.flatMap(repository::save);
}

@Override
public Mono<User> saveUser(User user) {
return repository.save(user);
}

@Override
public Mono<Void> deleteProfilePhoto(User visitor) {
String userAvatar = visitor.getAvatar();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public Mono<User> updateOrCreateUser(AuthUser authUser, boolean linkExistingUser
if (findByAuthUserFirst.userExist()) {
User user = findByAuthUserFirst.user();
updateConnection(authUser, user);
return userService.update(user.getId(), user);
return userService.saveUser(user);
}

//If the user connection is not found with login id, but the user is
Expand Down

0 comments on commit d895281

Please sign in to comment.