fix(upgrade): use authenticated status polling after restart

Remove the version header from the health endpoint and use upgrade status polling to determine completion.
This commit is contained in:
Andras Bacsai
2026-08-13 14:23:29 +02:00
parent 1932673c22
commit 6492d08136
4 changed files with 38 additions and 80 deletions
+7 -6
View File
@@ -119,23 +119,24 @@ it('ignores stale status files older than ten minutes', function () {
expect($result['status'])->toBe('none');
});
it('waits for the running version to match the target before showing reload', function () {
it('checks the running version through authenticated upgrade status before showing reload', function () {
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
expect($upgradeView)
->toContain('X-Coolify-Version')
->toContain('hasReachedTargetVersion')
->not->toContain('X-Coolify-Version')
->toContain('this.$wire.getUpgradeStatus()')
->toContain("data.status === 'complete'")
->toContain('livewireFailures');
});
it('treats a healthy instance without a version header as ready only after downtime', function () {
it('uses the public health endpoint only for liveness during an upgrade', function () {
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
expect($upgradeView)
->toContain('instanceWentDown')
->toContain('isReadyToReload')
->toContain('startHealthWatch')
->toContain('data.status === \'none\'');
->toContain("fetch('/api/health')")
->not->toContain('response.headers.get');
});
it('starts the upgrade after the Livewire response so status polling is not blocked', function () {