fix(heartbeat): show success/error notification to admin on install/update
Universal: Auto Version Bump / Version Bump (push) Successful in 8s
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Failing after 8s

Both install-time and runtime heartbeat now enqueue visible messages
for all outcomes — success, HTTP error, and connection failure — so
the admin always knows whether the heartbeat registered.
This commit is contained in:
Jonathan Miller
2026-06-20 18:53:54 -05:00
parent aa5f3ab06a
commit 49cc5becf6
2 changed files with 10 additions and 2 deletions
+6 -1
View File
@@ -970,19 +970,24 @@ class Pkg_MokosuiteclientInstallerScript
if ($error)
{
Log::add('Heartbeat connection failed: ' . $error, Log::WARNING, 'mokosuiteclient');
Factory::getApplication()->enqueueMessage('MokoSuiteHQ heartbeat failed: ' . $error, 'warning');
}
elseif ($code >= 200 && $code < 300)
{
Factory::getApplication()->enqueueMessage('MokoSuiteClientHQ heartbeat: site registered', 'message');
Factory::getApplication()->enqueueMessage('MokoSuiteHQ heartbeat: site registered successfully.', 'message');
}
else
{
$body = json_decode($response, true);
$msg = $body['error'] ?? $body['message'] ?? ('HTTP ' . $code);
Log::add(sprintf('Heartbeat HTTP %d: %s', $code, $response), Log::WARNING, 'mokosuiteclient');
Factory::getApplication()->enqueueMessage('MokoSuiteHQ heartbeat failed: ' . $msg, 'warning');
}
}
catch (\Throwable $e)
{
Log::add('Heartbeat failed: ' . $e->getMessage(), Log::WARNING, 'mokosuiteclient');
Factory::getApplication()->enqueueMessage('MokoSuiteHQ heartbeat failed: ' . $e->getMessage(), 'warning');
}
}