Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Wait for resolved session bootstrap before health checks

pulse-triage[bot]6d527555bdc3
diff --git a/frontend-modern/src/__tests__/useAppRuntimeState.test.ts b/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
index d51343f37b..eb45819798 100644
--- a/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
+++ b/frontend-modern/src/__tests__/useAppRuntimeState.test.ts
@@ -356,13 +356,13 @@ describe('useAppRuntimeState', () => {
const { hookState, dispose } = mountHook();
await waitFor(() => expect(hookState.isLoading()).toBe(false));
+ expect(clearAuthMock).not.toHaveBeenCalled();
+ expect(hookState.enhancedStore()).toBeNull();
+ expect(hookState.securityStatus()).toBeNull();
expect(hookState.bootstrapFailed()).toBe(true);
expect(hookState.needsAuth()).toBe(true);
expect(hookState.backendHealthy()).toBe(false);
- expect(hookState.enhancedStore()).toBeNull();
- expect(hookState.securityStatus()).toBeNull();
expect(hookState.activeOrgID()).toBe('acme');
- expect(clearAuthMock).not.toHaveBeenCalled();
expect(window.sessionStorage.getItem('auth')).toBe('synthetic-saved-token');
expect(window.sessionStorage.getItem('pulse_auth_user')).toBe('synthetic-operator');
expect(window.localStorage.getItem('org_id')).toBe('acme');
@@ -385,10 +385,10 @@ describe('useAppRuntimeState', () => {
const { hookState, dispose } = mountHook();
await waitFor(() => expect(hookState.isLoading()).toBe(false));
+ expect(hookState.enhancedStore()).toBeNull();
expect(hookState.bootstrapFailed()).toBe(true);
expect(hookState.needsAuth()).toBe(true);
expect(hookState.backendHealthy()).toBe(false);
- expect(hookState.enhancedStore()).toBeNull();
expect(clearAuthMock).not.toHaveBeenCalled();
expect(setOrgIDMock).not.toHaveBeenCalled();
expect(getRuntimeDisplayMock).not.toHaveBeenCalled();
diff --git a/frontend-modern/src/useAppRuntimeState.ts b/frontend-modern/src/useAppRuntimeState.ts
index abdf257cb5..6d66a1ee3d 100644
--- a/frontend-modern/src/useAppRuntimeState.ts
+++ b/frontend-modern/src/useAppRuntimeState.ts
@@ -604,7 +604,7 @@ export const useAppRuntimeState = () => {
});
createEffect(() => {
- if (!hasAuth()) {
+ if (isLoading() || needsAuth() || bootstrapFailed() || !hasAuth()) {
setBackendHealthy(false);
return;
}