@midwayjs/socketio 3.0.0-beta.6 → 3.0.0-beta.7

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 CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.0.0-beta.7](https://github.com/midwayjs/midway/compare/v3.0.0-beta.6...v3.0.0-beta.7) (2021-12-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * middleware with ctx.body ([#1389](https://github.com/midwayjs/midway/issues/1389)) ([77af5c0](https://github.com/midwayjs/midway/commit/77af5c0b456f1843f4dcfd3dbfd2c0aa244c51bd))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.0.0-beta.6](https://github.com/midwayjs/midway/compare/v3.0.0-beta.5...v3.0.0-beta.6) (2021-11-26)
7
18
 
8
19
  **Note:** Version bump only for package @midwayjs/socketio
package/dist/framework.js CHANGED
@@ -93,14 +93,11 @@ let MidwaySocketIOFramework = class MidwaySocketIOFramework extends core_1.BaseF
93
93
  // on user custom event
94
94
  socket.on(wsEventInfo.messageEventName, async (...args) => {
95
95
  debug('got message', wsEventInfo.messageEventName, args);
96
- const { result, error } = await (await this.getMiddleware(async (ctx, next) => {
97
- // eslint-disable-next-line prefer-spread
98
- return controller[wsEventInfo.propertyName].apply(controller, args);
99
- }))(socket);
100
- if (error) {
101
- this.logger.error(error);
102
- }
103
- else {
96
+ try {
97
+ const result = await (await this.getMiddleware(async (ctx, next) => {
98
+ // eslint-disable-next-line prefer-spread
99
+ return controller[wsEventInfo.propertyName].apply(controller, args);
100
+ }))(socket);
104
101
  if (typeof args[args.length - 1] === 'function') {
105
102
  // ack
106
103
  args[args.length - 1](result);
@@ -110,6 +107,9 @@ let MidwaySocketIOFramework = class MidwaySocketIOFramework extends core_1.BaseF
110
107
  await this.bindSocketResponse(result, socket, wsEventInfo.propertyName, methodMap);
111
108
  }
112
109
  }
110
+ catch (error) {
111
+ this.logger.error(error);
112
+ }
113
113
  });
114
114
  }
115
115
  else if (wsEventInfo.eventType === decorator_1.WSEventTypeEnum.ON_DISCONNECTION) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/socketio",
3
- "version": "3.0.0-beta.6",
3
+ "version": "3.0.0-beta.7",
4
4
  "description": "Midway Web Framework for socket.io",
5
5
  "main": "dist/index",
6
6
  "typings": "dist/index.d.ts",
@@ -23,15 +23,15 @@
23
23
  ],
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@midwayjs/decorator": "^3.0.0-beta.6",
27
- "@midwayjs/mock": "^3.0.0-beta.6",
26
+ "@midwayjs/decorator": "^3.0.0-beta.7",
27
+ "@midwayjs/mock": "^3.0.0-beta.7",
28
28
  "@types/socket.io-client": "^1.4.36",
29
29
  "fs-extra": "^8.0.1",
30
30
  "socket.io-client": "^4.0.0"
31
31
  },
32
32
  "dependencies": {
33
- "@midwayjs/core": "^3.0.0-beta.6",
34
- "@midwayjs/logger": "^3.0.0-beta.6",
33
+ "@midwayjs/core": "^3.0.0-beta.7",
34
+ "@midwayjs/logger": "^3.0.0-beta.7",
35
35
  "socket.io": "^4.0.0",
36
36
  "socket.io-redis": "^6.1.0"
37
37
  },
@@ -43,5 +43,5 @@
43
43
  "engines": {
44
44
  "node": ">=12"
45
45
  },
46
- "gitHead": "e4595d30b369e36bef21b36f2b3737d8bc2f802d"
46
+ "gitHead": "24590729121d9110e2d960db5b5e587cf55a1efc"
47
47
  }