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.

Finish Patrol registry ordering and native abort browser checks

pulse-triage[bot]df9b6d962018
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 1530edb78d..be6d34564a 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -6929,6 +6929,7 @@
"frontend-modern/src/features/patrol/patrolInvestigationContextModel.ts",
"frontend-modern/src/features/patrol/PatrolObjectivesPanel.tsx",
"frontend-modern/src/features/patrol/PatrolRecentWorkPanel.tsx",
+ "frontend-modern/src/features/patrol/PatrolSuppressionRules.tsx",
"frontend-modern/src/features/patrol/usePatrolIntelligenceState.ts",
"frontend-modern/src/pages/AIIntelligence.tsx",
"frontend-modern/src/stores/aiIntelligence.ts",
@@ -6947,8 +6948,7 @@
"frontend-modern/src/utils/patrolRuntimeActions.ts",
"frontend-modern/src/utils/patrolRuntimePresentation.ts",
"frontend-modern/src/utils/patrolSummaryPresentation.ts",
- "frontend-modern/src/utils/remediationPresentation.ts",
- "frontend-modern/src/features/patrol/PatrolSuppressionRules.tsx"
+ "frontend-modern/src/utils/remediationPresentation.ts"
],
"verification": {
"allow_same_subsystem_tests": false,
diff --git a/frontend-modern/browser-tests/patrol-rule-removal.cjs b/frontend-modern/browser-tests/patrol-rule-removal.cjs
index bc0a577435..418ded52c6 100644
--- a/frontend-modern/browser-tests/patrol-rule-removal.cjs
+++ b/frontend-modern/browser-tests/patrol-rule-removal.cjs
@@ -34,7 +34,9 @@ assert.equal(
].version,
);
-async function journey(root, engine, width, parent = false, resume = false, visualOnly = false) {
+async function journey(
+ root, engine, width, parent = false, resume = false, visualOnly = false, compatibility = false,
+) {
process.chdir(root);
const { createServer } = await import(path.join(root, 'node_modules/vite/dist/node/index.js'));
const server = await createServer({
@@ -346,6 +348,45 @@ async function journey(root, engine, width, parent = false, resume = false, visu
waitUntil: 'domcontentloaded',
timeout: 60000,
});
+ if (compatibility) {
+ await page.waitForFunction(() => Boolean(window.__patrolRuleRemoval?.apiFetch));
+ result.abortCompatibility = await page.evaluate(async () => {
+ const originalFetch = window.fetch;
+ const observed = [];
+ try {
+ for (const options of [{}, { retry: false }, { expectedOrgID: 'fixture-tenant-a' }]) {
+ let calls = 0;
+ window.fetch = (...args) => {
+ calls += 1;
+ return originalFetch(...args);
+ };
+ const controller = new AbortController();
+ controller.abort();
+ let errorName;
+ try {
+ await window.__patrolRuleRemoval.apiFetch('/api/aborted-confirmation', {
+ ...options,
+ signal: controller.signal,
+ });
+ } catch (error) {
+ errorName = error.name;
+ }
+ observed.push({ options, calls, errorName });
+ }
+ } finally {
+ window.fetch = originalFetch;
+ }
+ return observed;
+ });
+ assert.deepEqual(result.abortCompatibility.map((x) => x.calls), [1, 0, 0]);
+ assert.deepEqual(result.abortCompatibility.map((x) => x.errorName), [
+ 'AbortError', 'AbortError', 'AbortError',
+ ]);
+ assert.equal(result.requests.filter((r) => r.path === '/api/aborted-confirmation').length, 0);
+ result.checks.push(
+ 'Default pre-aborted API calls delegate once to native fetch; strict retry:false and expectedOrgID opt-ins stop before dispatch. All reject AbortError without a network request.',
+ );
+ }
let dialog;
if (visualOnly) {
await page.getByRole('tab', { name: 'Activity' }).click();
diff --git a/frontend-modern/browser-tests/patrol-rule-removal.tsx b/frontend-modern/browser-tests/patrol-rule-removal.tsx
index d0f80b9ef4..69f590aad4 100644
--- a/frontend-modern/browser-tests/patrol-rule-removal.tsx
+++ b/frontend-modern/browser-tests/patrol-rule-removal.tsx
@@ -4,11 +4,12 @@ import { Route, Router } from '@solidjs/router';
import { render } from 'solid-js/web';
import { PatrolIntelligenceSurface } from '../src/features/patrol/PatrolIntelligenceSurface';
import { eventBus } from '../src/stores/events';
-import { setOrgID } from '../src/utils/apiClient';
+import { apiFetch, setOrgID } from '../src/utils/apiClient';
import '../src/index.css';
setOrgID('fixture-tenant-a');
(window as any).__patrolRuleRemoval = {
+ apiFetch,
switchOrg: () => {
setOrgID('fixture-tenant-b');
eventBus.emit('org_switched', 'fixture-tenant-b');