Skip to content

feat(pubsub): add support for streaming pull keepalives from the server - #7819

Merged
feywind merged 19 commits into
mainfrom
pubsub-stream-keepalives
Jul 9, 2026
Merged

feat(pubsub): add support for streaming pull keepalives from the server#7819
feywind merged 19 commits into
mainfrom
pubsub-stream-keepalives

Conversation

@feywind

@feywind feywind commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Adds the keepalive support.

Fixes #7818 🦕

@product-auto-label product-auto-label Bot added the api: pubsub Issues related to the Pub/Sub API. label Mar 18, 2026
Comment thread handwritten/pubsub/src/message-stream.ts Outdated
this.emit('data', data);
}

private _resetPingTimer(index: number): void {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't thought about the exact practical differences between what's written here and what's in the Java client, but I think we should probably just mimic the behavior of the latter.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is updated now. Take a look?

@feywind
feywind marked this pull request as ready for review March 31, 2026 20:19
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 31, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Mar 31, 2026
@feywind feywind added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Mar 31, 2026
@feywind

feywind commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

We're not proceeding with this for now.

@feywind feywind closed this Mar 31, 2026
@feywind feywind removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label May 26, 2026
@feywind feywind reopened this May 26, 2026
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 26, 2026
@gcf-owl-bot
gcf-owl-bot Bot requested a review from a team as a code owner May 26, 2026 21:34
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label May 27, 2026
Comment thread handwritten/pubsub/src/message-stream.ts Outdated
Comment thread handwritten/pubsub/src/message-stream.ts Outdated
@pearigee

pearigee commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces server keepalive support in MessageStream by setting the protocol version and client ID, tracking ping/response times, and adding tests. The feedback suggests optimizing the keepalive mechanism by replacing the setInterval polling with a precise setTimeout triggered on pings, reusing the _clearAliveTimer helper to reduce duplication, avoiding starting the timer prematurely on initial connection, and updating the unit tests accordingly.

Comment thread handwritten/pubsub/src/message-stream.ts
Comment thread handwritten/pubsub/src/message-stream.ts
Comment thread handwritten/pubsub/src/message-stream.ts Outdated
Comment thread handwritten/pubsub/src/message-stream.ts
Comment thread handwritten/pubsub/test/message-stream.ts
feywind and others added 3 commits June 5, 2026 15:58
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 5, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 5, 2026
@feywind feywind added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 8, 2026
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jun 8, 2026
@shivanee-p
shivanee-p requested review from shivanee-p and removed request for shivanee-p June 22, 2026 21:16
@feywind
feywind merged commit 3881dca into main Jul 9, 2026
38 checks passed
@feywind
feywind deleted the pubsub-stream-keepalives branch July 9, 2026 20:35
quirogas added a commit that referenced this pull request Jul 10, 2026
…#8845)

* feat(pubsub): add support for streaming pull keepalives from the server (#7819)

* feat(pubsub): add support for streaming pull keepalives from the server

* feat(pubsub): update algorithm to match Java impl

* fix(pubsub): correct clientId value

* chore: improve comment

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix: accept gemini suggestion for setTimeout

* fix: accept gemini suggestion

* fix: accept gemini suggestion

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* fix: accept gemini suggestion

* fix: accept gemini test suggestion

* fix: pull timeout into a constant

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* chore(main): release projectify 5.1.0 (#8741)

:robot: I have created a release *beep* *boop*
---


## [5.1.0](https://togithub.com/googleapis/google-cloud-node/compare/projectify-v5.0.1...projectify-v5.1.0) (2026-06-24)


### Features

* Update API sources and regenerate ([#8672](https://togithub.com/googleapis/google-cloud-node/issues/8672)) ([3391fd2](https://togithub.com/googleapis/google-cloud-node/commit/3391fd27d1c15e051293207a07c6db00e760d370))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).

* chore: standardize node engines semver range to >=18 across all package manifests (#8842)

Standardize the Node.js engine requirement under "engines.node" to ">=18" across all 122 package manifests in the repository.

Previously, package manifests across the monorepo used a mix of format variations (such as ">=18.0.0", ">=v18", or legacy ranges like ">=14"). While npm's semver parser silently strips leading "v" characters and trailing zeroes, official Semantic Versioning (SemVer 2.0.0) specifications and strict manifest validators require numeric version strings without letter prefixes.

---------

Co-authored-by: feywind <57276408+feywind@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: pubsub Issues related to the Pub/Sub API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[pubsub] Add support for streaming pull keepalives from the server

4 participants