@cocreate/socket-server 1.29.0 → 1.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/index.js +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.29.2](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.29.1...v1.29.2) (2024-06-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* temporarily handle sending messages that dont have modules ([f1f6407](https://github.com/CoCreate-app/CoCreate-socket-server/commit/f1f6407817b95040accebd9fc4523a1817928ff2))
|
|
7
|
+
|
|
8
|
+
## [1.29.1](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.29.0...v1.29.1) (2024-04-26)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* clearTimout if userid seesion is reconnected ([4895fff](https://github.com/CoCreate-app/CoCreate-socket-server/commit/4895fff37e85eb2cdd3bb985804e8c362268360e))
|
|
14
|
+
|
|
1
15
|
# [1.29.0](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.28.3...v1.29.0) (2024-03-18)
|
|
2
16
|
|
|
3
17
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -192,10 +192,11 @@ class SocketServer extends EventEmitter {
|
|
|
192
192
|
let user = this.users.get(socket.user_id)
|
|
193
193
|
|
|
194
194
|
if (!user) {
|
|
195
|
-
clearTimeout(user)
|
|
196
195
|
this.users.set(socket.user_id, { [socket.id]: socket })
|
|
197
|
-
} else
|
|
196
|
+
} else {
|
|
197
|
+
clearTimeout(user)
|
|
198
198
|
user[socket.id] = socket
|
|
199
|
+
}
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
}
|
|
@@ -431,9 +432,12 @@ class SocketServer extends EventEmitter {
|
|
|
431
432
|
if (authorized.authorized)
|
|
432
433
|
data = authorized.authorized
|
|
433
434
|
|
|
435
|
+
// TODO: handle non module cases where send is required from messages
|
|
434
436
|
let moduleName = data.method.split('.')[0]
|
|
435
437
|
if (['storage', 'database', 'array', 'index', 'object'].includes(moduleName))
|
|
436
438
|
this.emit(data.method, data);
|
|
439
|
+
else if (data.method === 'crdt' || data.method === 'cursor')
|
|
440
|
+
this.send(data);
|
|
437
441
|
else
|
|
438
442
|
this.emit(moduleName, data);
|
|
439
443
|
}
|