feat(client): add digital sync retry details

This commit is contained in:
baiyanyun
2026-06-07 01:17:07 +08:00
parent 0672e82fc7
commit 508406ff10
10 changed files with 230 additions and 140 deletions

View File

@@ -71,6 +71,8 @@ interface QimingclawSyncFailure {
operation: string;
attempts: number;
lastAttemptAt: string | null;
nextRetryAt?: string | null;
dueForRetry?: boolean;
error: string | null;
createdAt: string;
updatedAt: string;
@@ -392,7 +394,12 @@ function compactSyncText(value?: string | null): string {
function syncFailureLine(failure: QimingclawSyncFailure): string {
const error = compactSyncText(failure.error);
const detail = error.length > 120 ? `${error.slice(0, 120)}...` : error;
return `${failure.entityType}/${failure.operation} ${failure.id} 重试 ${failure.attempts}${detail ? `${detail}` : ''}`;
const retryText = failure.dueForRetry
? '等待补偿'
: failure.nextRetryAt
? `下次重试 ${failure.nextRetryAt}`
: '等待重试';
return `${failure.entityType}/${failure.operation} ${failure.id} 重试 ${failure.attempts} 次,${retryText}${detail ? `${detail}` : ''}`;
}
function withRuntimePlan(plan: DebugPlan, snapshot: QimingclawSnapshot | null): DebugPlan {