@eleven-am/pondsocket 0.1.207 → 0.1.209

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.
@@ -75,6 +75,17 @@ class ChannelEngine {
75
75
  throw new httpError_1.HttpError(400, message);
76
76
  }
77
77
  const isFirstUser = this.users.size === 0;
78
+ // Acknowledge directly to the user as send message is asynchronous
79
+ onMessage({
80
+ channelName: __classPrivateFieldGet(this, _ChannelEngine_name, "f"),
81
+ requestId: (0, pondsocket_common_1.uuid)(),
82
+ action: pondsocket_common_1.ServerActions.SYSTEM,
83
+ event: pondsocket_common_1.Events.ACKNOWLEDGE,
84
+ payload: {
85
+ userId,
86
+ assigns,
87
+ },
88
+ });
78
89
  __classPrivateFieldGet(this, _ChannelEngine_assignsCache, "f").set(userId, assigns);
79
90
  __classPrivateFieldGet(this, _ChannelEngine_instances, "m", _ChannelEngine_buildSubscriber).call(this, userId, onMessage);
80
91
  if (isFirstUser && __classPrivateFieldGet(this, _ChannelEngine_backend, "f")) {
@@ -90,9 +101,6 @@ class ChannelEngine {
90
101
  assigns,
91
102
  });
92
103
  }
93
- // Send acknowledgment
94
- this.sendMessage(pondsocket_common_1.SystemSender.CHANNEL, [userId], pondsocket_common_1.ServerActions.SYSTEM, pondsocket_common_1.Events.ACKNOWLEDGE, {});
95
- // Return unsubscribe function
96
104
  return () => this.removeUser(userId);
97
105
  }
98
106
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleven-am/pondsocket",
3
- "version": "0.1.207",
3
+ "version": "0.1.209",
4
4
  "description": "PondSocket is a fast simple socket server",
5
5
  "keywords": [
6
6
  "socket",
@@ -44,10 +44,10 @@
44
44
  "@eslint/js": "^9.28.0",
45
45
  "@stylistic/eslint-plugin-ts": "^4.4.1",
46
46
  "@types/jest": "^29.5.14",
47
- "@types/node": "^22.15.30",
47
+ "@types/node": "^22.15.31",
48
48
  "@types/ws": "^8.18.1",
49
- "@typescript-eslint/eslint-plugin": "^8.33.1",
50
- "@typescript-eslint/parser": "^8.33.1",
49
+ "@typescript-eslint/eslint-plugin": "^8.34.0",
50
+ "@typescript-eslint/parser": "^8.34.0",
51
51
  "eslint": "^9.28.0",
52
52
  "eslint-config-prettier": "^10.1.5",
53
53
  "eslint-import-resolver-node": "^0.3.9",
@@ -55,7 +55,7 @@
55
55
  "eslint-plugin-import": "^2.31.0",
56
56
  "eslint-plugin-prettier": "^5.4.1",
57
57
  "globals": "^16.2.0",
58
- "jest": "^29.7.0",
58
+ "jest": "^30.0.0",
59
59
  "prettier": "^3.5.3",
60
60
  "source-map-support": "^0.5.21",
61
61
  "supertest": "^7.1.1",