Skip to content

chore: use node 22 Set methods for websocket close state#4974

Open
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:set-methods
Open

chore: use node 22 Set methods for websocket close state#4974
trivikr wants to merge 1 commit intonodejs:mainfrom
trivikr:set-methods

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented Apr 4, 2026

This relates to...

N/A

Rationale

Node.js 22 supports the new Set relation methods, which make the WebSocket closing-handshake checks more explicit. This change centralizes the closing-handshake state set in the WebSocket constants module and reuses it across the WebSocket implementation instead of redefining it in multiple files.

Changes

  • Add closingHandshakeStates to the WebSocket constants module
  • Document closingHandshakeStates with JSDoc
  • Replace duplicated local closing-handshake sets with the shared constant
  • Use Set.prototype.isDisjointFrom() and Set.prototype.isSupersetOf() for closing-handshake checks

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A

Status

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.96%. Comparing base (48c7cf3) to head (0489090).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4974      +/-   ##
==========================================
- Coverage   92.96%   92.96%   -0.01%     
==========================================
  Files         111      111              
  Lines       35864    35852      -12     
==========================================
- Hits        33342    33330      -12     
  Misses       2522     2522              

☔ 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.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina requested a review from KhafraDev April 5, 2026 15:26
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.

3 participants