Skip to content

Releases: socketio/socket.io-adapter

2.5.4

22 Feb 08:37
5eae5a0
Compare
Choose a tag to compare

Bug Fixes

  • ensure the order of the commands (a13f35f)
  • types: ensure compatibility with TypeScript < 4.5 (ca397f3)

Links

2.5.3

21 Feb 11:39
549156c
Compare
Choose a tag to compare

Two abstract classes were imported from the Redis adapter repository:

  • the ClusterAdapter class, which manages the messages sent between the server instances of the cluster
  • the ClusterAdapterWithHeartbeat class, which extends the ClusterAdapter and adds a heartbeat mechanism in order to check the healthiness of the other instances

Other adapters can then just extend those classes and only have to implement the pub/sub mechanism (and not the internal chit-chat protocol):

class MyAdapter extends ClusterAdapterWithHeartbeat {
  constructor(nsp, pubSub, opts) {
    super(nsp, opts);
    this.pubSub = pubSub;
    pubSub.subscribe("main-channel", (message) => this.onMessage(message));
    pubSub.subscribe("specific-channel#" + this.uid, (response) => this.onResponse(response));
  }

  doPublish(message) {
    return this.pubSub.publish("main-channel", message);
  }

  doPublishResponse(requesterUid, response) {
    return this.pubSub.publish("specific-channel#" + requesterUid, response);
  }
}

Besides, the number of "timeout reached: only x responses received out of y" errors (which can happen when a server instance leaves the cluster) should be greatly reduced by this commit.

Bug Fixes

  • cluster: fix count in fetchSockets() method (80af4e9)
  • cluster: notify the other nodes when closing (0e23ff0)

Performance Improvements

  • cluster: use timer.refresh() (d99a71b)

Links

2.5.2

12 Jan 07:25
28f60b8
Compare
Choose a tag to compare

The ws dependency was moved from peerDependencies to dependencies, in order to prevent issues like this.

Links

2.5.1

06 Jan 11:03
4e3991f
Compare
Choose a tag to compare

Bug Fixes

  • properly precompute the WebSocket frames (99b0f18)

Links

2.5.0

06 Jan 08:30
00a8e75
Compare
Choose a tag to compare

Features

  • implement connection state recovery (f529412)

Performance Improvements

  • precompute the WebSocket frames when broadcasting (5f7b47d)

Links

2.4.0

30 Mar 06:06
b92d65c
Compare
Choose a tag to compare

Features

  • broadcast and expect multiple acks (a7f1c90)
  • notify listeners for each outgoing packet (38ee887)

Links

2.3.3

16 Nov 14:35
75854a7
Compare
Choose a tag to compare

Bug Fixes

  • fix broadcasting volatile packets with binary attachments (88eee59)

Links

2.3.2

28 Aug 06:22
d4ef54c
Compare
Choose a tag to compare

Bug Fixes

  • fix race condition when leaving rooms (#74) (912e13a)

Links

2.3.1

19 May 22:50
0667d82
Compare
Choose a tag to compare

Bug Fixes

  • restore compatibility with binary parsers (a33e42b)

Links

2.3.0

10 May 08:38
03bda43
Compare
Choose a tag to compare

Features

  • add a serverSideEmit empty function (c4cbd4b)
  • add support for the "wsPreEncoded" writing option (5579d40)

Links