Skip to content

Conversation

@nickbrowne
Copy link
Contributor

@nickbrowne nickbrowne commented Jan 28, 2025

We picked up this issue because the stats were returning nothing, so out of caution we rolled back to and older version in production until I could look at this again.

Turns out the type of wss.clients changed from Array to Set, so while all the document editing and so on was working fine, our stats tracking and inactive client reaping was not. This fixes both of those issues so we should be good to proceed with the upgrade again.

Screenshot at 2025-01-28 11-50-46

(note that I added some temporary logging to make it more obvious when an inactive connection was reaped)

To test, run the bin/exampleserver and visit http://localhost:8000/

You should see the stats tracking in the example server working correctly (it currently does not on master).

wss.clients is a Set rather than an Array after ws 2.x
websockets/ws#934
wss.clients is a Set rather than an Array after ws 2.x
websockets/ws#934
@nickbrowne nickbrowne merged commit 07c87b0 into master Jan 28, 2025
1 check passed
@tiagoamaro tiagoamaro deleted the 18904-fix-stats-track-and-inactive-client-reaping branch January 28, 2025 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants