fix(editor): Do not send health checks in preview (no-changelog) (#26484)

This commit is contained in:
Daria 2026-03-03 21:39:09 +02:00 committed by GitHub
parent edd0c9f0d1
commit 9a84403d2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

View File

@ -92,4 +92,22 @@ describe('useBackendStatus', () => {
expect(mockStopHeartbeat).toHaveBeenCalled();
});
it('should skip health checks in preview mode', async () => {
settingsStore.setSettings(
merge({}, defaultSettings, {
previewMode: true,
endpointHealth: '/internal/health',
}),
);
const wrapper = createWrapper();
await vi.waitFor(() => {
expect(mockFetch).not.toHaveBeenCalled();
expect(mockStartHeartbeat).not.toHaveBeenCalled();
});
wrapper.unmount();
});
});

View File

@ -59,6 +59,10 @@ export function useBackendStatus() {
});
onMounted(() => {
if (settingsStore.isPreviewMode) {
return;
}
// Initial health check and start polling
void updateOnlineStatus();
startHeartbeat();