public Mono<GroupInvitationsWithVersion> authAndQueryGroupInvitationsWithVersion(
            @NotNull Long userId,
            @NotNull Long groupId,
            @Nullable Date lastUpdatedDate) {
        try {
            Validator.notNull(userId, "userId");
            Validator.notNull(groupId, "groupId");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        return groupMemberService.isOwnerOrManager(userId, groupId, false)
                .flatMap(authenticated -> {
                    if (!authenticated) {
                        return Mono.error(ResponseException.get(
                                ResponseStatusCode.NOT_GROUP_OWNER_OR_MANAGER_TO_QUERY_GROUP_INVITATION));
                    }
                    return groupVersionService.queryGroupInvitationsVersion(groupId)
                            .flatMap(version -> {
                                if (DateTimeUtil.isAfterOrSame(lastUpdatedDate, version)) {
                                    return ResponseExceptionPublisherPool.alreadyUpToUpdate();
                                }
                                Recyclable<List<GroupInvitation>> recyclableList =
                                        ListRecycler.obtain();
                                return queryGroupInvitationsByGroupId(groupId)
                                        .collect(Collectors.toCollection(recyclableList::getValue))
                                        .map(groupInvitations -> {
                                            if (groupInvitations.isEmpty()) {
                                                throw ResponseException
                                                        .get(ResponseStatusCode.NO_CONTENT);
                                            }
                                            GroupInvitationsWithVersion.Builder builder =
                                                    ClientMessagePool
                                                            .getGroupInvitationsWithVersionBuilder()
                                                            .setLastUpdatedDate(version.getTime());
                                            int expireAfterSeconds = groupInvitationRepository
                                                    .getEntityExpireAfterSeconds();
                                            for (GroupInvitation invitation : groupInvitations) {
                                                builder.addGroupInvitations(ProtoModelConvertor
                                                        .groupInvitation2proto(invitation,
                                                                expireAfterSeconds)
                                                        .build());
                                            }
                                            return builder.build();
                                        })
                                        .doFinally(signalType -> recyclableList.recycle());
                            })
                            .switchIfEmpty(ResponseExceptionPublisherPool.alreadyUpToUpdate());
                });
    }
@return group ID, invitee ID, and status
turms-service/src/main/java/im/turms/service/domain/group/service/GroupInvitationService.java