Skip to content

Commit b82e923

Browse files
committed
change error message copy
1 parent de19d66 commit b82e923

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/hooks/use-import-export.tsx

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as Sentry from '@sentry/electron/renderer';
22
import { __ } from '@wordpress/i18n';
3+
import { sprintf } from '@wordpress/i18n';
34
import { createContext, useMemo, useState, useCallback, useContext } from 'react';
45
import { useIpcListener } from 'src/hooks/use-ipc-listener';
56
import { useSiteDetails } from 'src/hooks/use-site-details';
@@ -17,6 +18,7 @@ import {
1718
BackupArchiveInfo,
1819
BackupExtractProgressEventData,
1920
} from 'src/lib/import-export/import/types';
21+
import { IMPORT_EXPORT_RESPONSE_TIMEOUT_IN_HRS } from 'src/lib/wp-cli-process';
2022

2123
type ImportProgressState = {
2224
[ siteId: string ]: {
@@ -97,7 +99,12 @@ export const ImportExportProvider = ( { children }: { children: React.ReactNode
9799
) {
98100
await getIpcApi().showErrorMessageBox( {
99101
title: __( 'Failed importing site' ),
100-
message: __( 'Import process timed out. Very large import?' ),
102+
message: sprintf(
103+
__(
104+
'The import process timed out after %d hours, which can occur when processing very large imports. If the issue persists, please contact support.'
105+
),
106+
IMPORT_EXPORT_RESPONSE_TIMEOUT_IN_HRS
107+
),
101108
} );
102109
} else {
103110
await getIpcApi().showErrorMessageBox( {

src/lib/wp-cli-process.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export type WpCliResult = ReturnType< typeof executeWPCli >;
1212
export type MessageCanceled = { error: Error; canceled: boolean };
1313

1414
const DEFAULT_RESPONSE_TIMEOUT = 5 * 60 * 1000; // 5min
15-
const IMPORT_EXPORT_RESPONSE_TIMEOUT = 24 * 60 * 60 * 1000; // 24hr
15+
export const IMPORT_EXPORT_RESPONSE_TIMEOUT_IN_HRS = 6;
16+
const IMPORT_EXPORT_RESPONSE_TIMEOUT = IMPORT_EXPORT_RESPONSE_TIMEOUT_IN_HRS * 60 * 60 * 1000; // 6hr
1617

1718
export default class WpCliProcess {
1819
lastMessageId = 0;

0 commit comments

Comments
 (0)