fix: improve configuration readiness detection in setup flow

- Add system info to health endpoint including configPlaceholder status
- Update setup page to check correct health properties
- Include hasData and clientsInitialized flags for better readiness detection

This ensures the 'Continue to Pulse' button appears when the server is actually ready with data, not just when it times out.
This commit is contained in:
courtmanr@gmail.com
2025-05-30 11:49:11 +01:00
parent 647cdaa625
commit b684ca9205
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -167,6 +167,13 @@ app.get('/healthz', (req, res) => {
app.get('/api/health', (req, res) => {
try {
const healthSummary = stateManager.getHealthSummary();
// Add system info including placeholder status
const state = stateManager.getState();
healthSummary.system = {
configPlaceholder: state.isConfigPlaceholder || false,
hasData: stateManager.hasData(),
clientsInitialized: Object.keys(global.pulseApiClients?.apiClients || {}).length > 0
};
res.json(healthSummary);
} catch (error) {
console.error("Error in /api/health:", error);
+2 -2
View File
@@ -540,8 +540,8 @@
console.log('Health check response:', health);
// Check if the server has successfully loaded configuration
// Look for signs that API clients are initialized and not in placeholder mode
if (health.system && health.system.configPlaceholder === false) {
// Look for overall health and recent activity
if (health.overall === 'healthy' && health.lastUpdate && health.connections && health.connections.total > 0) {
showSuccess('Configuration applied successfully!', true, false);
// Re-enable the save button