@trigger.dev/core 0.0.0-prerelease-20250116155306 → 0.0.0-prerelease-20250116162419

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.
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.preventMultipleWaits = preventMultipleWaits;
4
+ const errors_js_1 = require("../errors.js");
5
+ const common_js_1 = require("../schemas/common.js");
6
+ const concurrentWaitErrorMessage = "Parallel waits are not supported, e.g. using Promise.all() around our wait functions.";
7
+ function preventMultipleWaits() {
8
+ let isExecutingWait = false;
9
+ return async (cb) => {
10
+ if (isExecutingWait) {
11
+ console.error(concurrentWaitErrorMessage);
12
+ throw new errors_js_1.InternalError({
13
+ code: common_js_1.TaskRunErrorCodes.TASK_DID_CONCURRENT_WAIT,
14
+ message: concurrentWaitErrorMessage,
15
+ skipRetrying: true,
16
+ showStackTrace: false,
17
+ });
18
+ }
19
+ isExecutingWait = true;
20
+ try {
21
+ //delay calling the callback by one tick
22
+ //(to ensure the first wait doesn't checkpoint before the second is called)
23
+ await Promise.resolve();
24
+ return await cb();
25
+ }
26
+ finally {
27
+ isExecutingWait = false;
28
+ }
29
+ };
30
+ }
31
+ //# sourceMappingURL=preventMultipleWaits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preventMultipleWaits.js","sourceRoot":"","sources":["../../../../src/v3/runtime/preventMultipleWaits.ts"],"names":[],"mappings":";;AAMA,oDAyBC;AA/BD,4CAA6C;AAC7C,oDAAyD;AAEzD,MAAM,0BAA0B,GAC9B,uFAAuF,CAAC;AAE1F,SAAgB,oBAAoB;IAClC,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,OAAO,KAAK,EAAK,EAAoB,EAAc,EAAE;QACnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC1C,MAAM,IAAI,yBAAa,CAAC;gBACtB,IAAI,EAAE,6BAAiB,CAAC,wBAAwB;gBAChD,OAAO,EAAE,0BAA0B;gBACnC,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QAED,eAAe,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC;YACH,wCAAwC;YACxC,2EAA2E;YAC3E,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,eAAe,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = "0.0.0-prerelease-20250116155306";
4
+ exports.VERSION = "0.0.0-prerelease-20250116162419";
5
5
  //# sourceMappingURL=version.js.map
@@ -15,6 +15,9 @@ export function preventMultipleWaits() {
15
15
  }
16
16
  isExecutingWait = true;
17
17
  try {
18
+ //delay calling the callback by one tick
19
+ //(to ensure the first wait doesn't checkpoint before the second is called)
20
+ await Promise.resolve();
18
21
  return await cb();
19
22
  }
20
23
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"preventMultipleWaits.js","sourceRoot":"","sources":["../../../../src/v3/runtime/preventMultipleWaits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,0BAA0B,GAC9B,uFAAuF,CAAC;AAE1F,MAAM,UAAU,oBAAoB;IAClC,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,OAAO,KAAK,EAAK,EAAoB,EAAc,EAAE;QACnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC1C,MAAM,IAAI,aAAa,CAAC;gBACtB,IAAI,EAAE,iBAAiB,CAAC,wBAAwB;gBAChD,OAAO,EAAE,0BAA0B;gBACnC,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QAED,eAAe,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,eAAe,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"preventMultipleWaits.js","sourceRoot":"","sources":["../../../../src/v3/runtime/preventMultipleWaits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,0BAA0B,GAC9B,uFAAuF,CAAC;AAE1F,MAAM,UAAU,oBAAoB;IAClC,IAAI,eAAe,GAAG,KAAK,CAAC;IAE5B,OAAO,KAAK,EAAK,EAAoB,EAAc,EAAE;QACnD,IAAI,eAAe,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC1C,MAAM,IAAI,aAAa,CAAC;gBACtB,IAAI,EAAE,iBAAiB,CAAC,wBAAwB;gBAChD,OAAO,EAAE,0BAA0B;gBACnC,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,KAAK;aACtB,CAAC,CAAC;QACL,CAAC;QAED,eAAe,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC;YACH,wCAAwC;YACxC,2EAA2E;YAC3E,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACxB,OAAO,MAAM,EAAE,EAAE,CAAC;QACpB,CAAC;gBAAS,CAAC;YACT,eAAe,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export const VERSION = "0.0.0-prerelease-20250116155306";
1
+ export const VERSION = "0.0.0-prerelease-20250116162419";
2
2
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trigger.dev/core",
3
- "version": "0.0.0-prerelease-20250116155306",
3
+ "version": "0.0.0-prerelease-20250116162419",
4
4
  "description": "Core code used across the Trigger.dev SDK and platform",
5
5
  "license": "MIT",
6
6
  "publishConfig": {