oak-backend-base 4.1.13 → 4.1.14

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.
@@ -144,7 +144,7 @@ class Synchronizer {
144
144
  }
145
145
  }, {});
146
146
  const entityIds = operEntityArr.map(ele => ele.entityId);
147
- return onSynchronized({
147
+ await onSynchronized({
148
148
  action: oper.action,
149
149
  data: oper.data,
150
150
  rowIds: entityIds,
@@ -153,10 +153,8 @@ class Synchronizer {
153
153
  }, context);
154
154
  }
155
155
  }
156
- /**
157
- * 自主将triggerData属性清零
158
- */
159
156
  const operIds = queue.map(ele => ele.oper.id);
157
+ // 在内部清理相应的triggerData
160
158
  await context.operate('oper', {
161
159
  id: await (0, uuid_1.generateNewIdAsync)(),
162
160
  action: 'update',
@@ -359,6 +357,7 @@ class Synchronizer {
359
357
  }
360
358
  }));
361
359
  if (unPushedIds.length > 0) {
360
+ // 在内部清理相应的triggerData
362
361
  await context.operate('oper', {
363
362
  id: await (0, uuid_1.generateNewIdAsync)(),
364
363
  action: 'update',
@@ -379,9 +378,15 @@ class Synchronizer {
379
378
  }
380
379
  }
381
380
  if (result) {
382
- const exception = result.find(ele => ele instanceof Error);
383
- if (exception) {
384
- throw exception;
381
+ const exceptions = result.filter(ele => ele instanceof Error);
382
+ if (exceptions.length > 0) {
383
+ const notPartialSuccess = exceptions.find(ele => !(ele instanceof types_1.OakPartialSuccess));
384
+ if (notPartialSuccess) {
385
+ throw notPartialSuccess;
386
+ }
387
+ else {
388
+ console.warn('出现了PartialSuccess,部分Oper同步失败,事务仍然提交');
389
+ }
385
390
  }
386
391
  }
387
392
  }
@@ -488,6 +493,7 @@ class Synchronizer {
488
493
  strict: 'makeSure',
489
494
  singleton: true,
490
495
  grouped: true,
496
+ cleanTriggerDataBySelf: true,
491
497
  check: (operation) => {
492
498
  const { data } = operation;
493
499
  const { targetEntity, action } = data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-backend-base",
3
- "version": "4.1.13",
3
+ "version": "4.1.14",
4
4
  "description": "oak-backend-base",
5
5
  "main": "lib/index",
6
6
  "author": {
@@ -22,7 +22,7 @@
22
22
  "node-schedule": "^2.1.0",
23
23
  "oak-common-aspect": "^3.0.5",
24
24
  "oak-db": "^3.3.5",
25
- "oak-domain": "^5.1.14",
25
+ "oak-domain": "^5.1.15",
26
26
  "oak-frontend-base": "^5.3.22",
27
27
  "socket.io": "^4.7.2",
28
28
  "socket.io-client": "^4.7.2",