Skip to content

🐞 Bug: maxExtensionTime Ignored in Subscription Constructor #2054

@AlessandroSteri

Description

@AlessandroSteri

Please make sure you have searched for information in the following guides.

A screenshot that you have tested with "Try this API".

TL;DR: When initializing a Subscription with a custom maxExtensionTime, the value is silently ignored and the default one (1h) is used instead.

Longer Story:
In this PR, maxExtensionMinutes was refactored to Subscriber.maxExtensionTime. However, the logic that handled custom values via setOptions was not carried over.

As a result, subscriber always uses the default maxExtensionTime from the constructor. When a custom maxExtensionTime is passed, it’s not applied, because Subscriber.setOptions doesn’t override the default.

Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.

https://gist.github.com/AlessandroSteri/67f0139cff1b92a5d31e47b5d99df99f

A step-by-step description of how to reproduce the issue, based on the linked reproduction.

  1. Create a pubsub Subscription passing maxExtensionTime different from the default 1h as option
  2. Observe that subscription._subscriber.maxExtensionTime is 1h and not the custom one

A clear and concise description of what the bug is, and what you expected to happen.

Bug: When initializing a Subscription with a custom maxExtensionTime, the value is silently ignored and the default one (1h) is used instead.

Expectation: Subscriber.setOptions should set the custom maxExtensionTime

A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **

  • It's a bug introduced in the aforementioned refactor
  • It's clear that the behaviour of that option is to configure the underlining subscriber

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the googleapis/nodejs-pubsub API.priority: p2Moderately-important priority. Fix may not be included in next release.size: sPull request size is small.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions