helixevo 0.2.20 → 0.2.21
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.
|
@@ -57,47 +57,28 @@ export function UpdateBanner({ currentVersion }: { currentVersion: string }) {
|
|
|
57
57
|
setState('success')
|
|
58
58
|
setNewVersion(data.version)
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
} catch {}
|
|
60
|
+
// Tell server to restart, then wait and reload
|
|
61
|
+
try {
|
|
62
|
+
await fetch('/api/restart', { method: 'POST' })
|
|
63
|
+
} catch {}
|
|
65
64
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
await new Promise(r => setTimeout(r, 1000))
|
|
70
|
-
try {
|
|
71
|
-
await fetch('/api/restart', { method: 'GET', signal: AbortSignal.timeout(1000) })
|
|
72
|
-
// Still up — keep waiting
|
|
73
|
-
} catch {
|
|
74
|
-
serverDown = true
|
|
75
|
-
break
|
|
76
|
-
}
|
|
77
|
-
}
|
|
65
|
+
// Wait for: shutdown (2s) + port release (2s) + restart + compile (~8s)
|
|
66
|
+
// Then try to reload, retrying if server isn't ready
|
|
67
|
+
await new Promise(r => setTimeout(r, 6000))
|
|
78
68
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
await
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
if (res.ok) {
|
|
91
|
-
// Step 4: Hard reload with cache busting
|
|
92
|
-
window.location.href = window.location.pathname + '?updated=' + Date.now()
|
|
93
|
-
return
|
|
94
|
-
}
|
|
95
|
-
} catch {}
|
|
96
|
-
}
|
|
69
|
+
for (let attempt = 0; attempt < 20; attempt++) {
|
|
70
|
+
try {
|
|
71
|
+
const check = await fetch('/?_bust=' + Date.now(), { cache: 'no-store' })
|
|
72
|
+
if (check.ok) {
|
|
73
|
+
window.location.href = window.location.pathname + '?updated=' + Date.now()
|
|
74
|
+
return
|
|
75
|
+
}
|
|
76
|
+
} catch {}
|
|
77
|
+
await new Promise(r => setTimeout(r, 2000))
|
|
78
|
+
}
|
|
97
79
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}, 1500)
|
|
80
|
+
// Final fallback
|
|
81
|
+
window.location.href = window.location.pathname + '?updated=' + Date.now()
|
|
101
82
|
} else {
|
|
102
83
|
setState('error')
|
|
103
84
|
setErrorMsg(data.error ?? 'Update failed')
|
package/package.json
CHANGED