tycono 0.1.96-beta.55 → 0.1.96-beta.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -35,14 +35,29 @@ export const SetupWizard: React.FC<SetupWizardProps> = ({ onComplete }) => {
|
|
|
35
35
|
const [resultRoles, setResultRoles] = useState(0);
|
|
36
36
|
const [errorMsg, setErrorMsg] = useState('');
|
|
37
37
|
|
|
38
|
-
// Load team templates
|
|
38
|
+
// Load team templates with retry — same-process server+client
|
|
39
|
+
// can have event loop contention causing ECONNRESET or timeout
|
|
39
40
|
useEffect(() => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
let cancelled = false;
|
|
42
|
+
const load = async (attempt = 0): Promise<void> => {
|
|
43
|
+
if (cancelled) return;
|
|
44
|
+
// Delay to let Ink's render cycle settle
|
|
45
|
+
await new Promise(r => setTimeout(r, attempt === 0 ? 1000 : 2000));
|
|
46
|
+
if (cancelled) return;
|
|
47
|
+
try {
|
|
48
|
+
const teams = await fetchSetupTeams();
|
|
49
|
+
if (!cancelled) setTeams(teams);
|
|
50
|
+
} catch (err) {
|
|
51
|
+
if (cancelled) return;
|
|
52
|
+
if (attempt < 3) {
|
|
53
|
+
return load(attempt + 1);
|
|
54
|
+
}
|
|
55
|
+
setErrorMsg(`Failed to load team templates: ${err instanceof Error ? err.message : 'unknown'}`);
|
|
44
56
|
setStep('error');
|
|
45
|
-
}
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
load();
|
|
60
|
+
return () => { cancelled = true; };
|
|
46
61
|
}, []);
|
|
47
62
|
|
|
48
63
|
// Esc to cancel (only during input steps)
|