public Mono<DeleteResult> deleteRelatedUserFromRelationshipGroup(
            @NotNull Long ownerId,
            @NotNull Long relatedUserId,
            @NotNull Integer groupIndex,
            @Nullable ClientSession session,
            boolean updateRelationshipGroupsMembersVersion) {
        try {
            Validator.notNull(ownerId, "ownerId");
            Validator.notNull(relatedUserId, "relatedUserId");
            Validator.notNull(groupIndex, "groupIndex");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        Mono<DeleteResult> deleteMono = userRelationshipGroupMemberRepository
                .deleteRelatedUserFromRelationshipGroup(ownerId,
                        relatedUserId,
                        groupIndex,
                        session);
        if (updateRelationshipGroupsMembersVersion) {
            return deleteMono.flatMap(result -> {
                if (result.getDeletedCount() == 0) {
                    return Mono.empty();
                }
                return userVersionService.updateRelationshipGroupsMembersVersion(ownerId)
                        .onErrorResume(t -> {
                            LOGGER.error(
                                    "Caught an error while updating the relationship groups members version of the owner ({}) after deleting the user ({}) from the group ({})",
                                    ownerId,
                                    relatedUserId,
                                    groupIndex,
                                    t);
                            return Mono.empty();
                        })
                        .thenReturn(result);
            });
        }
        return deleteMono;
    }
@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