Skip to content

Fix missing heartbeat query parameter - #526

Merged
parfeon merged 4 commits into
masterfrom
fix/missing-heartbeat-query
Oct 13, 2026
Merged

parfeon merged 4 commits into
masterfrom
fix/missing-heartbeat-query

Conversation

@parfeon

@parfeon parfeon commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

fix(subscription): fix missing heartbeat query parameter

Fix the missing heartbeat query parameter for the new subscription flow on handshake and receive messages state.

Fix the missing `heartbeat` query parameter for the new subscription flow on `handshake` and
`receive messages` state.
@parfeon parfeon self-assigned this Oct 13, 2026
@parfeon parfeon added the status: done This issue is considered resolved. label Oct 13, 2026
@parfeon parfeon added type: bug This issue reports a bug. priority: high This PR should be reviewed ASAP. labels Oct 13, 2026
@pubnub-snyk-universal-prd

pubnub-snyk-universal-prd Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5aea28a8-2cad-4ab6-ad7e-e7cc123146a8
📥 Commits

Reviewing files that changed from the base of the PR and between 4a0cddf and 4181430.

⛔ Files ignored due to path filters (2)
  • dist/web/pubnub.js is excluded by !**/dist/**
  • dist/web/pubnub.min.js is excluded by !**/dist/**, !**/*.min.js
📒 Files selected for processing (6)
  • .pubnub.yml
  • CHANGELOG.md
  • README.md
  • lib/core/components/configuration.js
  • package.json
  • src/core/components/configuration.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

Subscribe requests now include a heartbeat query parameter when a heartbeat value is available. PubNubCore uses the configured presence timeout when the supplied heartbeat is falsy. Integration tests cover default, configured, and legacy subscribe requests. Release metadata identifies version 13.1.1.

Changes: Subscribe heartbeat propagation

Layer / File(s) Summary
Set subscribe heartbeat defaults
src/core/pubnub-common.ts, lib/core/pubnub-common.js
subscribeHandshake and subscribeReceiveMessages use the configured presence timeout when parameters.heartbeat is falsy.
Add heartbeat to request queries
src/core/endpoints/subscriptionUtils/handshake.ts, src/core/endpoints/subscriptionUtils/receiveMessages.ts, lib/core/endpoints/subscriptionUtils/handshake.js, lib/core/endpoints/subscriptionUtils/receiveMessages.js
Handshake and receive query parameters include heartbeat when its value is truthy.
Validate heartbeat request parameters
test/utils.ts, test/integration/endpoints/subscribe.test.ts, test/integration/endpoints/subscribe_heartbeat.test.ts
Mocks and integration tests check default and configured Event Engine heartbeat values. The legacy subscribe test checks the configured heartbeat and verifies that the request omits ee.
Update release version metadata
.pubnub.yml, CHANGELOG.md, README.md, package.json, lib/core/components/configuration.js, src/core/components/configuration.ts
Release notes, package and configuration versions, and CDN references change from 13.1.0 to 13.1.1.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 41814

The subscribe requests now carry the configured or default heartbeat, and the reviewed release metadata is consistent. No actionable merge-blocking risk remains.

Pre-merge checks · Passed 5
Passed Passed checks (5 passed)
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: fixing the missing heartbeat query parameter.
Description check Passed The description directly explains that the fix adds the missing heartbeat query parameter to the new subscription flow states.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

package.json

Oops! Something went wrong! :(

ESLint: 8.57.1

ReferenceError: convertToJson is not defined
at Object.cr [as parseSourceFile] (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:14:125387)
at hh (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:14:124001)
at e0 (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:17:69969)
at I4 (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:17:73936)
at c0 (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:17:73713)
at file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:22:1504
at u0 (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:17:74256)
at Object.h3 [as parse] (file:///.eslint-tmp/node_modules/prettier/plugins/typescript.mjs:22:1488)
at parse8 (file:///.eslint-tmp/node_modules/prettier/index.mjs:17739:24)
at async coreFormat (file:///.eslint-tmp/node_modules/prettier/index.mjs:18282:7)

src/core/components/configuration.ts

ESLint skipped: the matched ESLint configuration already failed (unknown).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread test/integration/endpoints/subscribe.test.ts
@parfeon

parfeon commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

@pubnub-release-bot release release

@mohitpubnub

Copy link
Copy Markdown
Contributor

@pubnub-release-bot release

@parfeon
parfeon merged commit 81cf274 into master Oct 13, 2026
16 of 22 checks passed
@parfeon
parfeon deleted the fix/missing-heartbeat-query branch October 13, 2026 07:21
@pubnub-release-bot

Copy link
Copy Markdown
Contributor

🚀 Release successfully completed 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: high This PR should be reviewed ASAP. status: done This issue is considered resolved. type: bug This issue reports a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants