GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add missing `close` method to WebSocketStream interface by piotr-cz · Pull Request #4802 · nodejs/undici

Conversation

@piotr-cz

@piotr-cz piotr-cz commented Feb 3, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

This relates to...

  • No related issues reported

Rationale

This adds missing close method to WebSocketStream interface, (see MDN Reference).

Method is already defined, but missing in interface:

undici/lib/web/websocket/stream/websocketstream.js

Lines 185 to 198 in 6cc668d

close (closeInfo = undefined) {
if (closeInfo !== null) {
closeInfo = webidl.converters.WebSocketCloseInfo(closeInfo)
}
// 1. Let code be closeInfo [" closeCode "] if present, or null otherwise.
const code = closeInfo.closeCode ?? null
// 2. Let reason be closeInfo [" reason "].
const reason = closeInfo.reason
// 3. Close the WebSocket with this , code , and reason .
closeWebSocketConnection(this.#handler, code, reason, true)
}

Changes

See diff

Features

N/A if not

Bug Fixes

N/A

Breaking Changes and Deprecations

No breaking changes

Status

  • I have read and agreed to the Developer's Certificate of Origin
  • [S] Tested
  • [S] Benchmarked (optional)
  • [S] Documented
  • Review ready
  • [S] In review
  • Merge ready

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@piotr-cz
Add close method to WebSocketStream interface
e1d3b1d
KhafraDev
KhafraDev approved these changes Feb 3, 2026
View reviewed changes
@codecov-commenter

codecov-commenter commented Feb 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.23%. Comparing base (dae4d91) to head (e1d3b1d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4802      +/-   ##
==========================================
- Coverage   93.24%   93.23%   -0.01%     
==========================================
  Files         109      109              
  Lines       34100    34100              
==========================================
- Hits        31796    31793       -3     
- Misses       2304     2307       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@KhafraDev
KhafraDev merged commit ff6bc5a into nodejs:main Feb 3, 2026
35 of 36 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@piotr-cz
piotr-cz deleted the patch-1 branch February 4, 2026 07:55
@github-actions github-actions Bot mentioned this pull request Feb 6, 2026
[Release] v7.21.0 #4813
Merged
slagiewka pushed a commit to slagiewka/undici that referenced this pull request Feb 14, 2026
@piotr-cz @slagiewka
Add close method to WebSocketStream interface (nodejs#4802)
44ac9c8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@KhafraDev KhafraDev KhafraDev approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@piotr-cz @codecov-commenter @KhafraDev
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.