feat(FN-1899): add login timeout, cancellation, and 409 conflict handling

- Add LoginOutcome type ('pending' | 'success' | 'failed' | 'timeout') with state tracking
- Implement AbortController-based cancellation for OAuth login flows
- Add timeout detection after MAX_POLL_CYCLES (150 polls, ~5 min)
- Handle 409 Conflict when concurrent login is attempted
- Persist login outcomes to onboarding stepData for session recovery
- Add getStepData mock export to App.test.tsx vi.mock
- Fix ToastType: use 'info' instead of invalid 'warning' type
This commit is contained in:
Fusion
2026-04-16 00:26:01 -07:00
committed by gsxdsm
parent dfb0a836be
commit 4fb8be4273
3 changed files with 6 additions and 4 deletions

View File

@@ -248,7 +248,7 @@ export function ModelOnboardingModal({
}
setAuthActionInProgress(null);
setLoginOutcomes((prev) => ({ ...prev, [providerId]: "timeout" }));
addToast("Login timed out. Please try again.", "warning");
addToast("Login timed out. Please try again.", "info");
return;
}
@@ -276,7 +276,7 @@ export function ModelOnboardingModal({
(err && typeof err === "object" && "status" in err && (err as { status: number }).status === 409);
if (isConcurrentLogin) {
addToast("Login already in progress. Please wait or cancel the current attempt.", "warning");
addToast("Login already in progress. Please wait or cancel the current attempt.", "info");
setLoginOutcomes((prev) => ({ ...prev, [providerId]: "failed" }));
} else {
addToast(err instanceof Error ? err.message : "Login failed", "error");