Skip to content

Commit b39f5d5

Browse files
chore(release): 0.3.0
Diff: 0.2.1...0.3.0
1 parent e77063b commit b39f5d5

File tree

4 files changed

+37
-4
lines changed

4 files changed

+37
-4
lines changed

CHANGELOG.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
# History
2+
3+
- [0.3.0](#030-2023-02-23) (Feb 2023)
4+
- [0.2.1](#021-2022-05-03) (May 2022)
5+
- [0.2.0](#020-2022-04-27) (Apr 2022)
6+
- [0.1.0](#010-2021-06-01) (Jun 2021)
7+
8+
# Release notes
9+
10+
## [0.3.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.2.1...0.3.0) (2023-02-23)
11+
12+
13+
### Features
14+
15+
#### Connection state recovery
16+
17+
This adapter is now compatible with the connection state recovery feature, which was added in `socket.io@4.6.0`.
18+
19+
Reference: https://socket.io/docs/v4/connection-state-recovery
20+
21+
Added in [02e4d57](https://github.com/socketio/socket.io-mongo-adapter/commit/02e4d57721937ce832fc9a83abddaecd4f8d38aa).
22+
23+
#### Resume token
24+
25+
Upon reconnection to the MongoDB server, the client will now try to resume the stream at the last offset it has processed.
26+
27+
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).
28+
29+
Added in [e77063b](https://github.com/socketio/socket.io-mongo-adapter/commit/e77063b8fd88b68df58e7bfdc7f3ef4edb51dca0).
30+
31+
32+
133
## [0.2.1](https://github.com/socketio/socket.io-mongo-adapter/compare/0.2.0...0.2.1) (2022-05-03)
234

335

@@ -7,7 +39,7 @@
739

840

941

10-
# [0.2.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.1.0...0.2.0) (2022-04-27)
42+
## [0.2.0](https://github.com/socketio/socket.io-mongo-adapter/compare/0.1.0...0.2.0) (2022-04-27)
1143

1244

1345
### Features
@@ -32,7 +64,7 @@ Thanks to this change, it will now work with multiple Socket.IO servers.
3264

3365
The adapter will now create one single MongoDB stream for all namespaces, instead of one per namespace, which could lead to performance issues.
3466

35-
# 0.1.0 (2021-06-01)
67+
## 0.1.0 (2021-06-01)
3668

3769
Initial commit
3870

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Supported features:
1515
- [`disconnectSockets`](https://socket.io/docs/v4/server-instance/#disconnectSockets)
1616
- [`fetchSockets`](https://socket.io/docs/v4/server-instance/#fetchSockets)
1717
- [`serverSideEmit`](https://socket.io/docs/v4/server-instance/#serverSideEmit)
18+
- [`Connection state recovery`](https://socket.io/docs/v4/connection-state-recovery)
1819

1920
Related packages:
2021

lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ export class MongoAdapter extends Adapter {
827827

828828
const session = results[0].value.data;
829829

830-
// could use a sparse index on [_id, data.opts.rooms, data.opts.except] (only index the documents whose type is EventType.BROADCAST)
830+
// could use a sparse index on [_id, nsp, data.opts.rooms, data.opts.except] (only index the documents whose type is EventType.BROADCAST)
831831
const cursor = this.mongoCollection.find({
832832
$and: [
833833
{

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socket.io/mongo-adapter",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"description": "The Socket.IO MongoDB adapter, allowing to broadcast events between several Socket.IO servers",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)