From b39f5d5b32f6a5dd6535a54d4dc9c9da1749b0c8 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Thu, 23 Feb 2023 08:33:34 +0100 Subject: [PATCH] chore(release): 0.3.0 Diff: https://github.com/socketio/socket.io-mongo-adapter/compare/0.2.1...0.3.0 --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++-- README.md | 1 + lib/index.ts | 2 +- package.json | 2 +- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b1571d..1f65cec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,35 @@ +# History + +- [0.3.0](#030-2023-02-23) (Feb 2023) +- [0.2.1](#021-2022-05-03) (May 2022) +- [0.2.0](#020-2022-04-27) (Apr 2022) +- [0.1.0](#010-2021-06-01) (Jun 2021) + +# Release notes + +## [0.3.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.2.1...0.3.0) (2023-02-23) + + +### Features + +#### Connection state recovery + +This adapter is now compatible with the connection state recovery feature, which was added in `socket.io@4.6.0`. + +Reference: https://socket.io/docs/v4/connection-state-recovery + +Added in [02e4d57](https://github.com/socketio/socket.io-mongo-adapter/commit/02e4d57721937ce832fc9a83abddaecd4f8d38aa). + +#### Resume token + +Upon reconnection to the MongoDB server, the client will now try to resume the stream at the last offset it has processed. + +If the MongoDB client is disconnected for too long and its token is no longer valid, then the Socket.IO clients connected to this server may miss some packets (which was the previous behavior). + +Added in [e77063b](https://github.com/socketio/socket.io-mongo-adapter/commit/e77063b8fd88b68df58e7bfdc7f3ef4edb51dca0). + + + ## [0.2.1](https://github.com/socketio/socket.io-mongo-adapter/compare/0.2.0...0.2.1) (2022-05-03) @@ -7,7 +39,7 @@ -# [0.2.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.1.0...0.2.0) (2022-04-27) +## [0.2.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.1.0...0.2.0) (2022-04-27) ### Features @@ -32,7 +64,7 @@ Thanks to this change, it will now work with multiple Socket.IO servers. The adapter will now create one single MongoDB stream for all namespaces, instead of one per namespace, which could lead to performance issues. -# 0.1.0 (2021-06-01) +## 0.1.0 (2021-06-01) Initial commit diff --git a/README.md b/README.md index fd3a807..9f93c9f 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ Supported features: - [`disconnectSockets`](https://socket.io/docs/v4/server-instance/#disconnectSockets) - [`fetchSockets`](https://socket.io/docs/v4/server-instance/#fetchSockets) - [`serverSideEmit`](https://socket.io/docs/v4/server-instance/#serverSideEmit) +- [`Connection state recovery`](https://socket.io/docs/v4/connection-state-recovery) Related packages: diff --git a/lib/index.ts b/lib/index.ts index 4391f2f..c14606a 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -827,7 +827,7 @@ export class MongoAdapter extends Adapter { const session = results[0].value.data; - // could use a sparse index on [_id, data.opts.rooms, data.opts.except] (only index the documents whose type is EventType.BROADCAST) + // could use a sparse index on [_id, nsp, data.opts.rooms, data.opts.except] (only index the documents whose type is EventType.BROADCAST) const cursor = this.mongoCollection.find({ $and: [ { diff --git a/package.json b/package.json index c31f74c..c0445b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@socket.io/mongo-adapter", - "version": "0.2.1", + "version": "0.3.0", "description": "The Socket.IO MongoDB adapter, allowing to broadcast events between several Socket.IO servers", "license": "MIT", "repository": {