fix(upgrade): handle missing status after restart (#11350)
This commit is contained in:
parent
a3e78a3677
commit
c9d5c4c41f
2 changed files with 20 additions and 0 deletions
|
|
@ -295,6 +295,16 @@ class="flex flex-wrap items-center justify-end gap-2 border-t border-neutral-200
|
|||
}
|
||||
throw error;
|
||||
}
|
||||
if (!data) {
|
||||
if (this.instanceWentDown) {
|
||||
// The upgraded instance can no longer return data for the old Livewire component.
|
||||
// A healthy response after observed downtime confirms that the restart completed.
|
||||
this.showSuccess();
|
||||
} else {
|
||||
this.currentStatus = this.getReviveStatusMessage(elapsedMinutes, this.healthCheckAttempts);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (data.status === 'complete') {
|
||||
this.showSuccess();
|
||||
} else if (data.status === 'error') {
|
||||
|
|
|
|||
|
|
@ -149,6 +149,16 @@
|
|||
->toContain('return;');
|
||||
});
|
||||
|
||||
it('finishes when the post-restart Livewire status response is undefined', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
expect($upgradeView)
|
||||
->toContain('if (!data) {')
|
||||
->toContain('if (this.instanceWentDown) {')
|
||||
->toContain('this.showSuccess();')
|
||||
->toContain('return;');
|
||||
});
|
||||
|
||||
it('tells users to reload manually if the automatic reload does not happen', function () {
|
||||
$upgradeView = file_get_contents(__DIR__.'/../../resources/views/livewire/upgrade.blade.php');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue