Skip to content

refactor/node-transport-undici#500

Merged
mohitpubnub merged 9 commits into
masterfrom
CLEN-3398-node-h2
Jun 22, 2026
Merged

refactor/node-transport-undici#500
mohitpubnub merged 9 commits into
masterfrom
CLEN-3398-node-h2

Conversation

@mohitpubnub

@mohitpubnub mohitpubnub commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

feat(node): h2 support via undici transport (replaces node-fetch)

Added HTTP/2 support for Node, upgrade minimum node version requirements to v22.

BREAKING CHANGES: Minimum supported Node.js version is now v22 (LTS). SOCKS,
PAC-file and environment-variable proxy resolution are no longer supported
following the migration to undici's ProxyAgent (HTTP/HTTPS proxies still work,
configured explicitly). react-native-url-polyfill is now an optional peer
dependency that React Native apps must install themselves.

fix: react-native specific dependency is made as optional peer-dependency for package dependency installation.

react native specific dependencies is made as peer-dependency for package dependency installation.

Closes #383

Mohit Tejani added 3 commits June 15, 2026 12:41
…build in fetch and raise engines node to leat LTS 22 version

single AbortSignal owns request timeout; disable undici internal headers/body/connect timeouts for parity
restore node-fetch error categorisation UND_ERR_ TIMEOUT, AggregateError unwrap
log ALPN-negotiated protocol via a custom connector
match keepAlive false TCP-keepalive behaviour
bump CI matrix to Node 22 and 24
@mohitpubnub mohitpubnub requested a review from parfeon as a code owner June 16, 2026 08:29
@pubnub-ops-terraform

pubnub-ops-terraform commented Jun 16, 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 Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 49ffeacf-4f9b-40a9-91a8-146665e29e80

📥 Commits

Reviewing files that changed from the base of the PR and between 4f5874d and c11d6c4.

⛔ Files ignored due to path filters (8)
  • .pubnub.yml is excluded by !.pubnub.yml and included by none
  • CHANGELOG.md is excluded by none and included by none
  • README.md is excluded by none and included by none
  • dist/web/pubnub.js is excluded by !**/dist/**, !dist/** and included by none
  • dist/web/pubnub.min.js is excluded by !**/dist/**, !**/*.min.js, !dist/** and included by none
  • lib/core/components/configuration.js is excluded by !lib/** and included by none
  • package.json is excluded by none and included by none
  • src/core/components/configuration.ts is excluded by none and included by none
📒 Files selected for processing (1)
  • .github/CODEOWNERS
✅ Files skipped from review due to trivial changes (1)
  • .github/CODEOWNERS

📝 Walkthrough

Walkthrough

The GitHub Actions tests job matrix for the ci:node environment is updated to run against Node.js versions 22 and 24 instead of 18.18.0 and 20. The include entry is adjusted from node: 18.18.0 to node: 22. The "Test docs snippets syntax" step condition is also updated from matrix.node == '18.18.0' to matrix.node == '22' to run on the new baseline version. Additionally, code ownership for the specified path is updated to include a new maintainer.

Changes

CI Node.js Matrix Update

Layer / File(s) Summary
Node.js version matrix and test condition
.github/workflows/run-tests.yml
Matrix versions for ci:node changed from [18.18.0, 20] to [22, 24]; include entry updated from node: 18.18.0 to node: 22. The "Test docs snippets syntax" step condition updated from matrix.node == '18.18.0' to matrix.node == '22' to align with the new baseline version.

Code Ownership Update

Layer / File(s) Summary
Code ownership assignment
.github/CODEOWNERS
Maintainer assignment updated by replacing one code owner with another.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'refactor/node-transport-undici' refers to a branch naming convention rather than describing the primary change; the actual change involves HTTP/2 support and undici transport, plus minimum Node.js version upgrade to v22. Revise the title to clearly describe the main change, such as 'feat: Add HTTP/2 support with undici transport and require Node.js v22'.
Linked Issues check ❓ Inconclusive The PR addresses issue #383's core requirement by making React Native-specific dependencies optional peer dependencies; however, file-level evidence is limited to workflow and CODEOWNERS changes, while package.json changes are excluded from review. Verify that package.json properly declares react-native-url-polyfill as an optional peer dependency (excluded file prevents full verification).
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining HTTP/2 support via undici, Node.js v22 upgrade, breaking changes, and React Native dependency fixes that address issue #383.
Out of Scope Changes check ✅ Passed The workflow file updates (Node.js 18→22 version matrix) and CODEOWNERS update are consistent with the stated objectives of upgrading to Node.js v22 and managing code ownership, with no unrelated changes detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CLEN-3398-node-h2

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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/run-tests.yml (1)

54-55: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Update stale snippets-test condition to match the new Node matrix.

if: matrix.node == '18.18.0' && matrix.env == 'ci:node' is now unreachable after moving the matrix to Node 22/24, so npm run test:snippets never runs.

Suggested fix
-      - name: Test docs snippets syntax
-        if: matrix.node == '18.18.0' && matrix.env == 'ci:node'
+      - name: Test docs snippets syntax
+        if: matrix.node == 22 && matrix.env == 'ci:node'
         run: npm run test:snippets

As per coding guidelines, .github/** workflows should be reviewed for valid workflow behavior; this condition currently disables an intended CI check.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/run-tests.yml around lines 54 - 55, The condition in the
snippets-test step checks for Node version 18.18.0, but the workflow matrix has
been updated to use Node versions 22 and 24, making this condition unreachable
and preventing the npm run test:snippets step from executing. Update the if
condition to match one of the current Node versions in the matrix so that the
snippets test runs as intended during the CI pipeline.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/run-tests.yml:
- Around line 54-55: The condition in the snippets-test step checks for Node
version 18.18.0, but the workflow matrix has been updated to use Node versions
22 and 24, making this condition unreachable and preventing the npm run
test:snippets step from executing. Update the if condition to match one of the
current Node versions in the matrix so that the snippets test runs as intended
during the CI pipeline.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5a1b576e-bd7c-45d4-8d05-2fb411d04f7c

📥 Commits

Reviewing files that changed from the base of the PR and between 94d7076 and 0450336.

⛔ Files ignored due to path filters (7)
  • lib/transport/node-transport.js is excluded by !lib/** and included by none
  • lib/types/index.d.ts is excluded by !lib/** and included by none
  • package-lock.json is excluded by !**/package-lock.json, !package-lock.json and included by none
  • package.json is excluded by none and included by none
  • src/node/index.ts is excluded by none and included by none
  • src/transport/node-transport.ts is excluded by none and included by none
  • test/unit/node-transport.test.ts is excluded by none and included by none
📒 Files selected for processing (1)
  • .github/workflows/run-tests.yml

@mohitpubnub

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

Comment thread package.json
Comment thread package.json Outdated
"node-fetch": "^2.7.0",
"proxy-agent": "^6.3.0",
"react-native-url-polyfill": "^2.0.0"
"react-native-url-polyfill": "^2.0.0",

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.

Should we put this to peerDependencies and document that user should install this if they are building for react-native (maybe with other polyfills)?

@mohitpubnub mohitpubnub self-assigned this Jun 22, 2026
@mohitpubnub

Copy link
Copy Markdown
Contributor Author

@pubnub-release-bot release

@mohitpubnub mohitpubnub merged commit c676005 into master Jun 22, 2026
10 checks passed
@mohitpubnub mohitpubnub deleted the CLEN-3398-node-h2 branch June 22, 2026 06:24
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SDK package too large for Lambda, contains frontend frameworks

4 participants