@intuned/runtime-dev 1.3.18-interface.18 → 1.3.18-interface.19

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.
@@ -109,7 +109,10 @@ async function runApi({
109
109
  (0, _cleanEnvironmentVariables.cleanEnvironmentVariables)();
110
110
  const automationFunctionParameters = [...(params !== undefined ? [params] : []), page, context];
111
111
  try {
112
- const [automationFunctionResult] = await Promise.all([automationFunction(...automationFunctionParameters)]);
112
+ const automationFunctionResult = await Promise.race([automationFunction(...automationFunctionParameters), abortPromise]);
113
+ if (automationFunctionResult === abortSymbol) {
114
+ return (0, _neverthrow.err)(new _runtimeInterface.AbortedError());
115
+ }
113
116
  const MAX_RESULT_SIZE_BYTES = 2 * 1024 * 1024;
114
117
  const resultSizeInBytes = getObjectSizeInBytes(automationFunctionResult);
115
118
  if (resultSizeInBytes > MAX_RESULT_SIZE_BYTES) {
@@ -157,11 +160,7 @@ async function runApi({
157
160
  }, runAutomationWithContext);
158
161
  }
159
162
  }
160
- const result = await Promise.race([await runAutomation(), abortPromise]);
161
- if (result === abortSymbol) {
162
- return (0, _neverthrow.err)(new _runtimeInterface.AbortedError());
163
- }
164
- return result;
163
+ return await runAutomation();
165
164
  }
166
165
  async function checkAuthSessionWithRetries(page, context, checkFn, retries = 3) {
167
166
  if (retries === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.3.18-interface.18",
3
+ "version": "1.3.18-interface.19",
4
4
  "description": "Intuned runtime",
5
5
  "packageManager": "yarn@4.12.0",
6
6
  "main": "./dist/index.js",