public Mono<DeleteResult> deleteAllRelationshipGroups(
            @NotEmpty Set<Long> ownerIds,
            @Nullable ClientSession session,
            boolean updateRelationshipGroupsVersion) {
        try {
            Validator.notEmpty(ownerIds, "ownerIds");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        Mono<DeleteResult> deleteMono =
                userRelationshipGroupRepository.deleteAllRelationshipGroups(ownerIds, session);
        if (updateRelationshipGroupsVersion) {
            return deleteMono
                    .flatMap(result -> userVersionService.updateRelationshipGroupsVersion(ownerIds)
                            .onErrorResume(t -> {
                                LOGGER.error(
                                        "Caught an error while updating the relationship groups version of the owners {} after deleting all groups",
                                        ownerIds,
                                        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