feat: add support for running status in account run history and UI
- Enhanced account run history to include 'running' status with appropriate translations and summaries. - Updated logging status to handle new error message format. - Introduced new properties for task progress in create-plus-checkout step. - Modified fill-plus-checkout step to handle additional error details. - Updated account records manager to display running status and summary correctly. - Added CSS styles for running status in account records. - Implemented logic to refresh account run history based on auto-run state changes. - Added tests for running status and idle log restart functionality in auto-run steps. - Improved account records manager tests to validate running state display and failure details.
This commit is contained in:
@@ -30,6 +30,9 @@
|
||||
if (normalized === 'success') {
|
||||
return 'success';
|
||||
}
|
||||
if (normalized === 'running' || /_running$/.test(normalized)) {
|
||||
return 'running';
|
||||
}
|
||||
if (normalized === 'failed' || /_failed$/.test(normalized)) {
|
||||
return 'failed';
|
||||
}
|
||||
@@ -157,6 +160,9 @@
|
||||
if (finalStatus === 'success') {
|
||||
return '流程完成';
|
||||
}
|
||||
if (finalStatus === 'running') {
|
||||
return '正在运行';
|
||||
}
|
||||
if (finalStatus === 'stopped') {
|
||||
if (Number.isInteger(failedStep) && failedStep > 0) {
|
||||
return `步骤 ${failedStep} 停止`;
|
||||
@@ -519,6 +525,8 @@
|
||||
summary.total += 1;
|
||||
if (record.finalStatus === 'success') {
|
||||
summary.success += 1;
|
||||
} else if (record.finalStatus === 'running') {
|
||||
summary.running += 1;
|
||||
} else if (record.finalStatus === 'failed') {
|
||||
summary.failed += 1;
|
||||
} else if (record.finalStatus === 'stopped') {
|
||||
@@ -529,6 +537,7 @@
|
||||
}, {
|
||||
total: 0,
|
||||
success: 0,
|
||||
running: 0,
|
||||
failed: 0,
|
||||
stopped: 0,
|
||||
retryTotal: 0,
|
||||
|
||||
@@ -73,7 +73,8 @@
|
||||
|
||||
function getErrorMessage(error) {
|
||||
return String(typeof error === 'string' ? error : error?.message || '')
|
||||
.replace(/^GPC_TASK_ENDED::/i, '');
|
||||
.replace(/^GPC_TASK_ENDED::/i, '')
|
||||
.replace(/^AUTO_RUN_STEP_IDLE_RESTART::/i, '');
|
||||
}
|
||||
|
||||
function isVerificationMailPollingError(error) {
|
||||
|
||||
@@ -413,6 +413,9 @@
|
||||
gopayHelperRemoteStage: result.remoteStage,
|
||||
gopayHelperPhoneMode: result.phoneMode || normalizeGpcHelperPhoneMode(state?.gopayHelperPhoneMode || state?.phoneMode),
|
||||
gopayHelperTaskPayload: result.responsePayload,
|
||||
gopayHelperTaskProgressSignature: '',
|
||||
gopayHelperTaskProgressAt: 0,
|
||||
gopayHelperTaskProgressTaskId: result.taskId,
|
||||
gopayHelperReferenceId: '',
|
||||
gopayHelperGoPayGuid: '',
|
||||
gopayHelperRedirectUrl: '',
|
||||
|
||||
@@ -795,11 +795,9 @@
|
||||
task?.api_waiting_for,
|
||||
task?.last_input_error,
|
||||
task?.otp_invalid_count,
|
||||
task?.reference_id || task?.referenceId,
|
||||
task?.redirect_url || task?.redirectUrl,
|
||||
task?.flow_id || task?.flowId,
|
||||
task?.challenge_id || task?.challengeId,
|
||||
task?.gopay_guid || task?.gopayGuid,
|
||||
task?.failure_stage || task?.failureStage,
|
||||
task?.failure_detail || task?.failureDetail,
|
||||
task?.error_message || task?.errorMessage,
|
||||
].map((value) => String(value ?? '').trim()).join('|');
|
||||
}
|
||||
|
||||
@@ -898,6 +896,9 @@
|
||||
gopayHelperFailureStage: '',
|
||||
gopayHelperFailureDetail: '',
|
||||
gopayHelperTaskPayload: null,
|
||||
gopayHelperTaskProgressSignature: '',
|
||||
gopayHelperTaskProgressAt: 0,
|
||||
gopayHelperTaskProgressTaskId: '',
|
||||
gopayHelperPinPayload: null,
|
||||
gopayHelperResolvedOtp: '',
|
||||
gopayHelperOtpRequestId: '',
|
||||
@@ -971,8 +972,14 @@
|
||||
let lastSubmittedOtp = '';
|
||||
let pinSubmitted = false;
|
||||
let terminalReached = false;
|
||||
let lastProgressSignature = '';
|
||||
let lastProgressAt = Date.now();
|
||||
let lastProgressSignature = String(state?.gopayHelperTaskProgressSignature || '').trim();
|
||||
let lastProgressAt = normalizeEpochMilliseconds(state?.gopayHelperTaskProgressAt || 0) || Date.now();
|
||||
let lastProgressTaskId = String(state?.gopayHelperTaskProgressTaskId || '').trim();
|
||||
if (lastProgressTaskId !== taskId) {
|
||||
lastProgressSignature = '';
|
||||
lastProgressAt = Date.now();
|
||||
lastProgressTaskId = '';
|
||||
}
|
||||
const staleStatusTimeoutMs = getGpcTaskStaleStatusTimeoutMs(state);
|
||||
|
||||
if (!taskId) {
|
||||
@@ -1025,15 +1032,27 @@
|
||||
if (shouldWatchGpcTaskProgress(task, state)) {
|
||||
const progressSignature = buildGpcTaskProgressSignature(task);
|
||||
const now = Date.now();
|
||||
if (progressSignature && progressSignature !== lastProgressSignature) {
|
||||
if (progressSignature && (progressSignature !== lastProgressSignature || lastProgressTaskId !== taskId)) {
|
||||
lastProgressSignature = progressSignature;
|
||||
lastProgressAt = now;
|
||||
lastProgressTaskId = taskId;
|
||||
await setState({
|
||||
gopayHelperTaskProgressSignature: progressSignature,
|
||||
gopayHelperTaskProgressAt: now,
|
||||
gopayHelperTaskProgressTaskId: taskId,
|
||||
});
|
||||
} else if (progressSignature && now - lastProgressAt >= staleStatusTimeoutMs) {
|
||||
throw buildGpcTaskStaleStatusError(task, staleStatusTimeoutMs);
|
||||
}
|
||||
} else {
|
||||
lastProgressSignature = '';
|
||||
lastProgressAt = Date.now();
|
||||
lastProgressTaskId = '';
|
||||
await setState({
|
||||
gopayHelperTaskProgressSignature: '',
|
||||
gopayHelperTaskProgressAt: 0,
|
||||
gopayHelperTaskProgressTaskId: taskId,
|
||||
});
|
||||
}
|
||||
|
||||
if (isGpcTaskOtpWait(task, state)) {
|
||||
|
||||
Reference in New Issue
Block a user