Fix: Prevent bypass of blocking validation errors

This commit is contained in:
gpt-engineer-app[bot]
2025-10-13 20:27:15 +00:00
parent dc21e2a6aa
commit 1d3c907c8a

View File

@@ -118,9 +118,10 @@ export function SubmissionReviewManager({
} else { } else {
next.add(itemId); next.add(itemId);
} }
// Clear blocking errors when selection changes // Clear blocking errors and warning confirmation when selection changes
setHasBlockingErrors(false); setHasBlockingErrors(false);
setValidationResults(new Map()); setValidationResults(new Map());
setUserConfirmedWarnings(false);
return next; return next;
}); });
}; };
@@ -179,7 +180,8 @@ export function SubmissionReviewManager({
return result && result.blockingErrors.length > 0; return result && result.blockingErrors.length > 0;
}); });
if (itemsWithBlockingErrors.length > 0 && !userConfirmedWarnings) { // CRITICAL: Blocking errors can NEVER be bypassed, regardless of warnings
if (itemsWithBlockingErrors.length > 0) {
setHasBlockingErrors(true); setHasBlockingErrors(true);
setShowValidationBlockerDialog(true); setShowValidationBlockerDialog(true);
setLoading(false); setLoading(false);
@@ -227,7 +229,10 @@ export function SubmissionReviewManager({
: `Successfully approved ${successCount} item(s)`, : `Successfully approved ${successCount} item(s)`,
variant: failCount > 0 ? 'destructive' : 'default', variant: failCount > 0 ? 'destructive' : 'default',
}); });
// Reset warning confirmation state after approval
setUserConfirmedWarnings(false);
onComplete(); onComplete();
onOpenChange(false); onOpenChange(false);
} catch (error: any) { } catch (error: any) {