feat: Implement retry logic for composite submissions

This commit is contained in:
gpt-engineer-app[bot]
2025-11-05 13:16:30 +00:00
parent 876119c079
commit 5e0640252c
3 changed files with 288 additions and 32 deletions

View File

@@ -113,7 +113,12 @@ export const handleError = (
p_error_message: errorMessage,
p_error_stack: stack,
p_user_agent: navigator.userAgent,
p_breadcrumbs: JSON.stringify(breadcrumbs),
p_breadcrumbs: JSON.stringify({
...breadcrumbs,
isRetry: context.metadata?.isRetry || false,
attempt: context.metadata?.attempt,
retriesExhausted: context.metadata?.retriesExhausted || false,
}),
p_timezone: envContext.timezone,
p_referrer: document.referrer || undefined,
p_duration_ms: context.duration,
@@ -126,11 +131,14 @@ export const handleError = (
logger.error('Failed to capture error context', { logError });
}
// Show user-friendly toast with error ID
toast.error(context.action, {
description: `${errorMessage}\n\nReference ID: ${shortErrorId}`,
duration: 5000,
});
// Show user-friendly toast with error ID (skip for retry attempts)
const isRetry = context.metadata?.isRetry === true || context.metadata?.attempt;
if (!isRetry) {
toast.error(context.action, {
description: `${errorMessage}\n\nReference ID: ${shortErrorId}`,
duration: 5000,
});
}
return errorId;
};