Skip to content

Infinite requests not working #55

@alice-watershed

Description

@alice-watershed

Subscriptions in 5.2.0 are not infinite: once we get 100 events we get the last event callback and the connection closes. I've debugged it to this line where subscription.info.isInfiniteEventRequest is set in the if statement but not in the else statement.

subscription = {

if (subscription) {
    this.#logger.debug(
      `${topicName} - Reusing cached gRPC subscription`
    );
    grpcSubscription = subscription.grpcSubscription;
    subscription.info.receivedEventCount = 0;
    subscription.info.requestedEventCount = subscribeRequest.numRequested;
    subscription.info.isInfiniteEventRequest = isInfiniteEventRequest;
} else {
    this.#logger.debug(
      `${topicName} - Establishing new gRPC subscription`
    );
    grpcSubscription = this.#client.Subscribe();
    subscription = {
      info: {
        isManaged: false,
        topicName,
        requestedEventCount: subscribeRequest.numRequested,
        receivedEventCount: 0,
        lastReplayId: null,
        isInfiniteEventRequest: isInfiniteEventRequest // NEW LINE NEEDED HERE
      },
      grpcSubscription,
      subscribeCallback
    };
    this.#subscriptions.set(topicName, subscription);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions