Repository navigation
fix(pubsub): align ClientConfig.port type with gax.GrpcClientOptions - #9539
Merged
danieljbruce merged 2 commits intoOct 6, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the ClientConfig interface in handwritten/pubsub/src/pubsub.ts to restrict the port property to only accept a number instead of string or number. There are no review comments, and I have no feedback to provide.
danieljbruce
marked this pull request as draft
October 6, 2026 17:15
danieljbruce
marked this pull request as ready for review
October 6, 2026 18:01
quirogas
reviewed
Oct 6, 2026
| callback, | ||
| ); | ||
| this.getClientAsync_(config) | ||
| // eslint-disable-next-line promise/no-callback-in-promise |
Contributor
There was a problem hiding this comment.
Nit: We should probably look more into this callback instead of disabling it.
Contributor
Author
There was a problem hiding this comment.
Sounds good. I put this in our backlog (https://b.corp.google.com/issues/570625459).
quirogas
approved these changes
Oct 6, 2026
Merged
shivanee-p
pushed a commit
that referenced
this pull request
Oct 6, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>google-gax: 6.11.1</summary> ## [6.11.1](google-gax-v6.11.0...google-gax-v6.11.1) (2026-10-06) ### Bug Fixes * **gax:** Only set resend_count on T4 attempt spans ([#9540](#9540)) ([3b3f600](3b3f600)) * **gax:** Widen port to number | string in GrpcClientOptions ([#9542](#9542)) ([17978e7](17978e7)) </details> <details><summary>pubsub: 6.1.1</summary> ## [6.1.1](pubsub-v6.1.0...pubsub-v6.1.1) (2026-10-06) ### Bug Fixes * **pubsub:** Align ClientConfig.port type with gax.GrpcClientOptions ([#9539](#9539)) ([4443d6d](4443d6d)) * **test-utils:** Make google-test-utils a private workspace package ([#9525](#9525)) ([be25b6f](be25b6f)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
This was referenced Oct 6, 2026
shivanee-p
added a commit
that referenced
this pull request
Oct 6, 2026
Reverts PR #9539 as to not break customers. The `port` type definition was expanded in PR#3542 as a non-breaking change. --------- Co-authored-by: Santiago Quiroga <[email protected]>
danieljbruce
added a commit
that referenced
this pull request
Oct 7, 2026
…ent_ (#9544) ## Description Replaces the `.then().catch()` promise chain and `promise/no-callback-in-promise` ESLint disable comments in `PubSub.prototype.getClient_` with an `async` IIFE and `try / catch` block. ## Impact Prevents synchronous errors thrown inside the `getClient_` callback from being caught by `.catch(callback)` and invoking the callback a second time, while satisfying `eslint-plugin-promise` rules without lint suppressions (follow-up to #9539). ## Changes - Refactored `PubSub.prototype.getClient_` in `handwritten/pubsub/src/pubsub.ts` to `await this.getClientAsync_(config)` inside a `try / catch` block within a `void (async () => { ... })()` IIFE and invoke `callback(null, client)` outside the `try / catch` block. - Removed the two `// eslint-disable-next-line promise/no-callback-in-promise` comments in `handwritten/pubsub/src/pubsub.ts`. ## Testing - Verified existing `getClient_` and `request` unit tests in `handwritten/pubsub/test/pubsub.ts` pass (`105 passing`). - Verified `GIT_DIFF_ARG=upstream/main node ./bin/linter.mjs --strict` passes with zero ESLint errors or warnings and passes TypeScript type checking. ## Alternatives - Keep the `.then().catch()` chain with `eslint-disable-next-line promise/no-callback-in-promise` comments: rejected because if `callback(null, client)` throws synchronously, `.catch(callback)` catches that error and invokes `callback` a second time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the
@google-cloud/pubsubpack-and-install system test failure (should be able to use the d.ts):Root Cause
In #9496 (released in
[email protected]),GrpcClientOptionsaddedport?: number;. In@google-cloud/pubsub,ClientConfigextendsgax.GrpcClientOptionsbut declaredport?: string | number;, causing TypeScript compilation withskipLibCheck: falseto fail when resolving[email protected]+.Internally,
PubSub#determineBaseUrl_already parsesportas anumber(orundefined), matchinggax.GrpcClientOptionsandgax.ClientOptions.Changes
ClientConfig.portinhandwritten/pubsub/src/pubsub.tsfromstring | numbertonumber.