public Mono<Boolean> addRelatedUserToRelationshipGroups(
            @NotNull Long ownerId,
            @NotNull Integer groupIndex,
            @NotNull Long relatedUserId,
            @Nullable ClientSession session) {
        try {
            Validator.notNull(groupIndex, "groupIndex");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        UserRelationshipGroupMember member =
                new UserRelationshipGroupMember(ownerId, groupIndex, relatedUserId, new Date());
        return userRelationshipGroupMemberRepository.upsert(member, session)
                .flatMap(updateResult -> {
                    boolean addedNewRelatedUser = updateResult.getUpsertedId() != null;
                    if (!addedNewRelatedUser && updateResult.getModifiedCount() <= 0) {
                        return PublisherPool.FALSE;
                    }
                    return userVersionService.updateRelationshipGroupsVersion(ownerId)
                            .onErrorResume(t -> {
                                LOGGER.error(
                                        "Caught an error while updating the relationship groups version of the owner ({}) after adding a user to the groups",
                                        ownerId,
                                        t);
                                return Mono.empty();
                            })
                            .thenReturn(addedNewRelatedUser);
                });
    }
@return true if added a new related user to the relationship group.
@implNote We call this method while upserting a relationship into the owner's relationship
          group in a transaction currently, so we don't check whether the owner has a
          relationship with the related user in this method.
turms-service/src/main/java/im/turms/service/domain/user/service/UserRelationshipGroupService.java