Skip to content

Commit adfb45b

Browse files
authored
chore: extend manifest import/export HTTP timeouts (#166)
Raise manifest import upload timeout to 2 minutes and export (validate + download) to 1 minute so slower server-side processing does not fail the CLI. Bump patch to 4.10.7.
1 parent 4c5e2fb commit adfb45b

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mondaycom/apps-cli",
3-
"version": "4.10.6",
3+
"version": "4.10.7",
44
"description": "A cli tool to manage apps (and monday-code projects) in monday.com",
55
"author": "monday.com Apps Team",
66
"type": "module",

src/services/export-manifest-service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ import { HttpError } from 'src/types/errors';
77
import { ExportCommandTasksContext } from 'types/commands/manifest-export';
88
import { AppId, AppVersionId } from 'types/general';
99
import { HttpMethodTypes } from 'types/services/api-service';
10+
import { TIME_IN_MILLISECONDS } from 'utils/time-utils';
1011
import { appsUrlBuilder } from 'utils/urls-builder';
1112

13+
const EXPORT_MANIFEST_HTTP_TIMEOUT_MS = TIME_IN_MILLISECONDS.MINUTE;
14+
1215
export const downloadManifestTask = async (
1316
ctx: ExportCommandTasksContext,
1417
task: ListrTaskWrapper<ExportCommandTasksContext, any>,
@@ -31,6 +34,7 @@ export const downloadManifest = async (appId: AppId, appVersionId?: AppVersionId
3134
url,
3235
method: HttpMethodTypes.GET,
3336
query: { ...(appVersionId && { appVersionId }) },
37+
timeout: EXPORT_MANIFEST_HTTP_TIMEOUT_MS,
3438
})) as any as { data: string };
3539

3640
return response.data;
@@ -54,6 +58,7 @@ export const validateManifest = async (appId: AppId, appVersionId?: AppVersionId
5458
url,
5559
method: HttpMethodTypes.POST,
5660
query: { ...(appVersionId && { appVersionId }) },
61+
timeout: EXPORT_MANIFEST_HTTP_TIMEOUT_MS,
5762
});
5863
} catch (error) {
5964
if (error instanceof HttpError && error.message.includes('Cannot create slugs for live version')) {

src/services/import-manifest-service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const updateAppFromManifest = async (buffer: Buffer, appId: AppId, appVersionId?
122122
method: HttpMethodTypes.PUT,
123123
body: formData,
124124
query: { ...(appVersionId && { appVersionId }) },
125-
timeout: TIME_IN_MILLISECONDS.SECOND * 30,
125+
timeout: TIME_IN_MILLISECONDS.MINUTE * 2,
126126
});
127127
return response;
128128
};
@@ -138,7 +138,7 @@ const createAppFromManifest = async (buffer: Buffer) => {
138138
headers: { Accept: 'application/json', 'Content-Type': 'multipart/form-data' },
139139
method: HttpMethodTypes.POST,
140140
body: formData,
141-
timeout: TIME_IN_MILLISECONDS.SECOND * 30,
141+
timeout: TIME_IN_MILLISECONDS.MINUTE * 2,
142142
});
143143
return response;
144144
};

0 commit comments

Comments
 (0)