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.

Keep notification activity truthful when evidence reads fail

pulse-triage[bot]9df89142d3ff
diff --git a/docs/release-control/v6/internal/subsystems/alerts.md b/docs/release-control/v6/internal/subsystems/alerts.md
index fefabf9828..20fd82c066 100644
--- a/docs/release-control/v6/internal/subsystems/alerts.md
+++ b/docs/release-control/v6/internal/subsystems/alerts.md
@@ -3236,3 +3236,25 @@ The monitor delegates recovery eligibility to persisted occurrence/destination
receipts even when an old retry remains or restart has lost RAM cooldown state.
The partial-destination monitor control establishes a real local HTTP 200/503
split and preserves the newer firing and the old recipient's recovery.
+
+### Notification activity reports each evidence source independently
+
+The existing Notifications activity card distinguishes an initial or pending
+read from a confirmed empty window. Held/deferred event reads have their own
+loading and unavailable state; a failed read withdraws their prior rows and
+keeps the warning until a later successful read. Only the current refresh owns
+those states, and disposed readers cannot publish late completions. A slow
+held-event read does not delay delivery attempts or disable their refresh.
+
+A delivery-attempt failure withdraws only attempt rows, not independently
+readable held events. Conversely, missing held evidence does not hide readable
+attempts or imply that no notifications were held. The combined empty state
+requires both sources to be readable and no refresh pending. Retention, event
+limits, queue actions, permissions and notification delivery policy are unchanged.
+
+`useNotificationDeliveryLog.test.tsx`, `useAlertDestinationsTabState.test.tsx`
+and `AlertDeliveryLogCard.test.tsx` exercise independent failure, recovery,
+initial loading and current-request ownership; the production Notifications
+tab browser fixture verifies the connected read/retry states at desktop and
+phone widths. These are synthetic frontend controls, not recipient delivery
+or containing-release acceptance.
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index a51a26ce5a..698506168e 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -7908,3 +7908,21 @@ kind normalisation, the kind switch, the email-only payload, and the plain
cover the gating, the reduced form, the pinned fields, and the saved payload.
This is a presentation and form-state boundary; the schedule API contract,
report rendering, and email delivery are unchanged.
+
+### Notifications activity has independent evidence-read states
+
+The Notifications tab composes the delivery-log card with both attempt-read
+and held/deferred-event loading and unavailable state from its owned reader.
+Pending or failed evidence is never rendered as a confirmed empty activity
+window. Each failed source withdraws its own rows without hiding independently
+readable rows from the other source. Source-specific warnings have `role="alert"`
+and loading text has `role="status"`; a slow held-event read does not block the
+existing attempt-refresh button. Recovery clears a warning only after a
+successful read, without remounting the destination editors or changing their
+unfinished input.
+
+The connected Notifications browser fixture uses the real tab/state/API/card
+chain at desktop and phone widths with keyboard/touch refresh, class-dark CSS,
+403/503 controls and pending recovery. Unit controls separately cover current
+request ownership and disposal. No mutation, route, navigation entry, queue
+policy, permission or recipient-delivery contract is added by these states.
diff --git a/frontend-modern/browser-tests/notification-evidence.cjs b/frontend-modern/browser-tests/notification-evidence.cjs
new file mode 100644
index 0000000000..8a6fef7319
--- /dev/null
+++ b/frontend-modern/browser-tests/notification-evidence.cjs
@@ -0,0 +1,383 @@
+const assert = require('node:assert/strict');
+const fs = require('node:fs');
+const path = require('node:path');
+const crypto = require('node:crypto');
+const { chromium, webkit } = require('playwright');
+const output = '/workspace/tmp/notification-evidence-proof';
+const root = '/workspace/frontend-modern';
+const runtime = [
+ 'frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx',
+ 'frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts',
+ 'frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts',
+ 'frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx',
+ 'frontend-modern/src/utils/alertDestinationsPresentation.ts',
+];
+const log = (entries = []) => ({
+ entries,
+ window_days: 30,
+ completed_retention_days: 7,
+ dead_letter_retention_days: 30,
+});
+const sent = {
+ notificationId: 'synthetic-attempt',
+ type: 'email',
+ outcome: 'sent',
+ alertIds: ['synthetic-disk-alert'],
+ alertCount: 1,
+ attempts: 1,
+ success: true,
+ timestamp: '2026-10-03T10:00:00Z',
+};
+const held = [
+ {
+ id: 42,
+ type: 'notification_deferred',
+ alertId: 'synthetic-held-alert',
+ resourceName: 'synthetic-nas',
+ alertType: 'usage',
+ reason: 'quiet_hours:performance',
+ occurredAt: '2026-10-03T10:01:00Z',
+ },
+];
+(async () => {
+ fs.mkdirSync(output, { recursive: true });
+ const playwrightVersion = require('playwright/package.json').version;
+ assert.equal(
+ playwrightVersion,
+ JSON.parse(fs.readFileSync('/workspace/tests/integration/package-lock.json')).packages[
+ 'node_modules/@playwright/test'
+ ].version,
+ );
+ const hashes = Object.fromEntries(
+ runtime.map((p) => [
+ p,
+ crypto
+ .createHash('sha256')
+ .update(fs.readFileSync(path.join('/workspace', p)))
+ .digest('hex'),
+ ]),
+ );
+ process.chdir(root);
+ const { createServer } = await import(path.join(root, 'node_modules/vite/dist/node/index.js'));
+ const server = await createServer({
+ root,
+ configFile: path.join(root, 'vite.config.ts'),
+ cacheDir: path.join(output, 'vite-cache'),
+ server: { host: '127.0.0.1', port: 5291, strictPort: true },
+ });
+ const results = [],
+ screens = [];
+ let browser;
+ try {
+ await server.listen();
+ for (const [name, engine, width, dark] of [
+ ['desktop', chromium, 1365, false],
+ ['phone', webkit, 390, true],
+ ]) {
+ browser = await engine.launch(
+ engine === chromium
+ ? { headless: true, channel: 'chromium', args: ['--no-sandbox'] }
+ : { headless: true },
+ );
+ const page = await browser.newPage({
+ viewport: { width, height: width === 390 ? 844 : 900 },
+ isMobile: width === 390,
+ hasTouch: width === 390,
+ locale: 'en-GB',
+ timezoneId: 'UTC',
+ });
+ page.setDefaultTimeout(20000);
+ const errors = [],
+ offOrigin = [],
+ writes = [],
+ requests = [],
+ checks = [],
+ releases = [];
+ let attemptMode = 'hold-empty',
+ heldMode = 'hold-empty';
+ page.on('pageerror', (error) => errors.push(error.message));
+ await page.route('**/*', async (route) => {
+ const request = route.request(),
+ url = new URL(request.url());
+ if (url.origin !== 'http://127.0.0.1:5291') {
+ offOrigin.push(url.origin);
+ return route.abort();
+ }
+ if (!url.pathname.startsWith('/api/')) return route.continue();
+ if (request.method() !== 'GET') {
+ writes.push({ method: request.method(), path: url.pathname });
+ return route.abort();
+ }
+ if (
+ url.pathname === '/api/notifications/delivery-log' ||
+ url.pathname === '/api/alerts/events'
+ ) {
+ const isHeld = url.pathname === '/api/alerts/events';
+ const mode = isHeld ? heldMode : attemptMode;
+ requests.push({ path: url.pathname, query: url.search, mode });
+ if (mode.startsWith('hold-'))
+ await new Promise((resolve) => releases.push({ isHeld, resolve }));
+ if (mode.endsWith('denied'))
+ return route.fulfill({
+ status: isHeld ? 403 : 503,
+ json: { error: 'Synthetic unavailable evidence' },
+ });
+ return route.fulfill({
+ json: isHeld
+ ? mode.endsWith('known')
+ ? held
+ : []
+ : log(mode.endsWith('known') ? [sent] : []),
+ });
+ }
+ if (url.pathname === '/api/notifications/health')
+ return route.fulfill({
+ json: {
+ overall_healthy: true,
+ queue: {
+ pending: 0,
+ sending: 0,
+ sent: 1,
+ failed: 0,
+ dlq: 0,
+ healthy: true,
+ status: 'healthy',
+ attention_required: 0,
+ reason_codes: [],
+ completed_retention_days: 7,
+ dead_letter_retention_days: 30,
+ counts_are_retention_bounded: true,
+ },
+ },
+ });
+ if (url.pathname === '/api/license/runtime-capabilities')
+ return route.fulfill({
+ json: {
+ capabilities: [],
+ limits: [],
+ max_history_days: 7,
+ hosted_mode: false,
+ runtime: { build: 'community' },
+ blocked_capabilities: [],
+ },
+ });
+ if (url.pathname === '/api/license/entitlements')
+ return route.fulfill({ json: { entitlements: [] } });
+ if (url.pathname === '/api/security/status')
+ return route.fulfill({ json: { hasAuthentication: true, requiresAuth: false } });
+ return route.fulfill({ json: [] });
+ });
+ const check = async (label, action) => {
+ await action();
+ checks.push({ label, passed: true });
+ };
+ const activity = page.locator('#notification-delivery-activity');
+ const empty = activity.getByText(/No alert deliveries were attempted/);
+ const heldWarning = activity.getByText(/could not read held or deferred notifications/);
+ const attemptWarning = activity.getByText(/could not read the delivery log/);
+ const refresh = activity.getByRole('button', { name: 'Refresh delivery status' });
+ const release = (isHeld) => {
+ for (const pending of releases.splice(0).filter((item) => {
+ if (item.isHeld === isHeld) {
+ item.resolve();
+ return false;
+ }
+ return true;
+ }))
+ releases.push(pending);
+ };
+ const capture = async (state) => {
+ const filename = `${name}-${state}.png`;
+ await activity.screenshot({ path: path.join(output, filename) });
+ screens.push({
+ file: filename,
+ state,
+ viewport: { width, height: width === 390 ? 844 : 900 },
+ sha256: crypto
+ .createHash('sha256')
+ .update(fs.readFileSync(path.join(output, filename)))
+ .digest('hex'),
+ });
+ };
+ try {
+ await page.goto('http://127.0.0.1:5291/browser-tests/notification-evidence.html');
+ await page.evaluate(
+ (dark) => document.documentElement.classList.toggle('dark', dark),
+ dark,
+ );
+ await check('Initial reads are loading, not empty', async () => {
+ await activity.getByText('Loading delivery attempts...').waitFor();
+ await activity.getByText('Loading held and deferred notifications...').waitFor();
+ assert.equal(await empty.count(), 0);
+ });
+ await check(
+ 'A slow held read does not block the successful attempts read or its refresh',
+ async () => {
+ release(false);
+ await activity.getByText('Loading delivery attempts...').waitFor({ state: 'hidden' });
+ assert.equal(await refresh.isEnabled(), true);
+ assert.equal(await empty.count(), 0);
+ await activity.getByText('Loading held and deferred notifications...').waitFor();
+ },
+ );
+ await capture('held-pending');
+ await check('Only two completed empty reads establish the empty window', async () => {
+ release(true);
+ await empty.waitFor();
+ assert.equal(await activity.getByRole('status').count(), 0);
+ });
+ await check(
+ 'Keyboard or touch refresh shows attempts and held events from their real API adapters',
+ async () => {
+ attemptMode = heldMode = 'known';
+ if (width === 390) await refresh.tap();
+ else {
+ await refresh.focus();
+ await page.keyboard.press('Enter');
+ }
+ await activity.getByText('Delivered', { exact: true }).waitFor();
+ await activity.getByText('synthetic-nas (usage)', { exact: true }).waitFor();
+ assert.equal(await empty.count(), 0);
+ },
+ );
+ await check(
+ 'Held-event 403 withdraws held rows and warns without hiding delivered evidence',
+ async () => {
+ heldMode = 'denied';
+ await refresh.click();
+ await heldWarning.waitFor();
+ assert.equal(
+ await activity.getByText('synthetic-nas (usage)', { exact: true }).count(),
+ 0,
+ );
+ assert.equal(await activity.getByText('Delivered', { exact: true }).count(), 1);
+ assert.equal(await empty.count(), 0);
+ },
+ );
+ await capture('held-unavailable');
+ await check('The held warning persists during a pending retry', async () => {
+ heldMode = 'hold-empty';
+ await refresh.click();
+ await activity.getByText('Loading held and deferred notifications...').waitFor();
+ assert.equal(await heldWarning.count(), 1);
+ await refresh.waitFor({ state: 'visible' });
+ await page.waitForFunction(
+ () => !document.querySelector('#notification-delivery-activity button').disabled,
+ );
+ assert.equal(await empty.count(), 0);
+ release(true);
+ await heldWarning.waitFor({ state: 'hidden' });
+ });
+ await check(
+ 'An attempt-read failure keeps independently readable held evidence',
+ async () => {
+ attemptMode = 'denied';
+ heldMode = 'known';
+ await refresh.click();
+ await attemptWarning.waitFor();
+ await activity.getByText('synthetic-nas (usage)', { exact: true }).waitFor();
+ assert.equal(await activity.getByText('Delivered', { exact: true }).count(), 0);
+ assert.equal(await empty.count(), 0);
+ },
+ );
+ await capture('attempts-unavailable');
+ await check('Both failed sources are reported, not called empty', async () => {
+ heldMode = 'denied';
+ await refresh.click();
+ await heldWarning.waitFor();
+ assert.equal(await attemptWarning.count(), 1);
+ assert.equal(await activity.getByRole('listitem').count(), 0);
+ assert.equal(await empty.count(), 0);
+ });
+ await check(
+ 'Both successful reads clear the warnings and restore a genuine empty state',
+ async () => {
+ attemptMode = heldMode = 'empty';
+ await refresh.click();
+ await empty.waitFor();
+ assert.equal(await activity.getByRole('alert').count(), 0);
+ assert.equal(await activity.getByRole('status').count(), 0);
+ },
+ );
+ await check(
+ 'No horizontal clipping, JavaScript page error, off-origin request or mutation',
+ async () => {
+ assert.equal(
+ await activity.evaluate((element) => element.scrollWidth <= element.clientWidth + 1),
+ true,
+ );
+ assert.deepEqual(errors, []);
+ assert.deepEqual(offOrigin, []);
+ assert.deepEqual(writes, []);
+ assert(
+ requests
+ .filter((r) => r.path === '/api/alerts/events')
+ .every(
+ (r) => r.query.includes('limit=100') && r.query.includes('notification_deferred'),
+ ),
+ );
+ assert(
+ requests
+ .filter((r) => r.path === '/api/notifications/delivery-log')
+ .every((r) => r.query === '?limit=200'),
+ );
+ },
+ );
+ results.push({
+ name,
+ browser_version: browser.version(),
+ dark,
+ checks,
+ requests,
+ errors,
+ offOrigin,
+ writes,
+ });
+ } finally {
+ for (const pending of releases) pending.resolve();
+ await browser.close();
+ browser = null;
+ }
+ }
+ fs.writeFileSync(
+ path.join(output, 'result.json'),
+ JSON.stringify(
+ {
+ passed: true,
+ playwright_version: playwrightVersion,
+ content_sha256: hashes,
+ changed_paths: runtime,
+ results,
+ screenshots: screens,
+ },
+ null,
+ 2,
+ ) + '\n',
+ );
+ console.log(
+ JSON.stringify({
+ passed: true,
+ checks: results.reduce((n, r) => n + r.checks.length, 0),
+ screenshots: screens.length,
+ playwright_version: playwrightVersion,
+ results: results.map((r) => ({ name: r.name, browser_version: r.browser_version })),
+ }),
+ );
+ } catch (error) {
+ fs.writeFileSync(
+ path.join(output, 'failed.json'),
+ JSON.stringify(
+ { passed: false, error: error.message, results, screenshots: screens },
+ null,
+ 2,
+ ) + '\n',
+ );
+ throw error;
+ } finally {
+ if (browser) await browser.close();
+ await server.close();
+ }
+})().catch((error) => {
+ console.error(error);
+ process.exitCode = 1;
+});
diff --git a/frontend-modern/browser-tests/notification-evidence.html b/frontend-modern/browser-tests/notification-evidence.html
new file mode 100644
index 0000000000..71c910e8fe
--- /dev/null
+++ b/frontend-modern/browser-tests/notification-evidence.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>Notification evidence verification</title>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module" src="./notification-evidence.tsx"></script>
+ </body>
+</html>
diff --git a/frontend-modern/browser-tests/notification-evidence.tsx b/frontend-modern/browser-tests/notification-evidence.tsx
new file mode 100644
index 0000000000..cd358e54b1
--- /dev/null
+++ b/frontend-modern/browser-tests/notification-evidence.tsx
@@ -0,0 +1,69 @@
+// The production Notifications tab and API readers with synthetic read responses.
+// No notification is sent, retried or dismissed by this fixture.
+import { createSignal } from 'solid-js';
+import { render } from 'solid-js/web';
+import { Router, Route } from '@solidjs/router';
+import { DestinationsTab } from '../src/features/alerts/tabs/DestinationsTab';
+import type { UIEmailConfig, UIAppriseConfig } from '../src/features/alerts/types';
+import '../src/index.css';
+
+function Fixture() {
+ const [emailConfig, setEmailConfig] = createSignal<UIEmailConfig>({
+ enabled: false,
+ provider: 'smtp',
+ server: '',
+ port: 587,
+ username: '',
+ password: '',
+ from: '',
+ to: [],
+ tls: true,
+ startTLS: true,
+ replyTo: '',
+ maxRetries: 3,
+ retryDelay: 5,
+ rateLimit: 60,
+ });
+ const [appriseConfig, setAppriseConfig] = createSignal<UIAppriseConfig>({
+ enabled: false,
+ mode: 'cli',
+ targetsText: '',
+ cliPath: '',
+ timeoutSeconds: 20,
+ serverUrl: '',
+ configKey: '',
+ apiKey: '',
+ apiKeyHeader: 'X-API-KEY',
+ skipTlsVerify: false,
+ hasApiKey: false,
+ });
+ return (
+ <main class="mx-auto max-w-4xl p-3 text-base-content">
+ <h1 class="mb-4 text-xl font-semibold">Notifications</h1>
+ <DestinationsTab
+ emailConfig={emailConfig}
+ setEmailConfig={setEmailConfig}
+ appriseConfig={appriseConfig}
+ setAppriseConfig={setAppriseConfig}
+ setHasUnsavedChanges={() => {}}
+ configLoadError={() => null}
+ isRetrying={() => false}
+ isLoadingDestinations={() => false}
+ onRetryLoad={() => {}}
+ webhooks={() => []}
+ deadManPingUrl={() => ''}
+ setDeadManPingUrl={() => {}}
+ pushMinimumSeverity={() => 'all'}
+ setPushMinimumSeverity={() => {}}
+ />
+ </main>
+ );
+}
+render(
+ () => (
+ <Router>
+ <Route path="/*" component={Fixture} />
+ </Router>
+ ),
+ document.getElementById('root')!,
+);
diff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.json
index 9ccfa044bd..453fe2f009 100644
--- a/frontend-modern/browser-verification.json
+++ b/frontend-modern/browser-verification.json
@@ -1,39 +1,28 @@
{
"version": 1,
"result": "passed",
- "base_sha": "7127054c659913b75abe302c5d377b8b6f49e9f2",
- "verified_at": "2026-10-03T08:47:10.724Z",
+ "base_sha": "2d6a10ab59d327b461ef762ec69a9c5d0440929a",
+ "verified_at": "2026-10-03T11:37:53.905511Z",
"changed_paths": [
- "frontend-modern/src/components/Workloads/StackedDiskBar.tsx",
- "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts",
- "frontend-modern/src/features/docker/DockerImagesTable.tsx",
- "frontend-modern/src/features/docker/DockerServicesTable.tsx",
- "frontend-modern/src/features/docker/DockerTasksTable.tsx",
- "frontend-modern/src/features/docker/dockerContainerTableModel.ts",
- "frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts",
- "frontend-modern/src/features/storageBackups/storageAdapters.ts",
- "frontend-modern/src/hooks/useUnifiedResources.ts"
+ "frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx",
+ "frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts",
+ "frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts",
+ "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx",
+ "frontend-modern/src/utils/alertDestinationsPresentation.ts"
],
"content_sha256": {
- "frontend-modern/src/components/Workloads/StackedDiskBar.tsx": "54f1f84dac768c6e0e333254d5c65e59751fa78b5ac55826cdaa37085a73c608",
- "frontend-modern/src/components/Workloads/stackedDiskBarModel.ts": "9fde1740e300724ef9cab4a3b036c942bdab6e5d2060f262606b27f4b1a40ea6",
- "frontend-modern/src/features/docker/DockerImagesTable.tsx": "29284b34d9631f118a449da1c274b1028e3cea57aed37a3ac056e48e05b2b613",
- "frontend-modern/src/features/docker/DockerServicesTable.tsx": "5a153e4b3533849ae952dadb50e512fadb87fcc9fba05403509168d8bb5caba6",
- "frontend-modern/src/features/docker/DockerTasksTable.tsx": "58cf1656ba22475b52dc9a582a4d8f0cc8c01f38bfb3775518edac73dbf22b80",
- "frontend-modern/src/features/docker/dockerContainerTableModel.ts": "b821b9caf65d5c247e543a6d6dbf0925f735b617c6393066d0f8c15a10e05e72",
- "frontend-modern/src/features/storageBackups/resourceStoragePresentation.ts": "933723fb9afeeb53afa46946a346daca19d50c0d61a81fc0730498ebd8c09bb2",
- "frontend-modern/src/features/storageBackups/storageAdapters.ts": "daa85c5d99903d5a5fb10070837106b91f06ad130cae320472b2d980b979fb48",
- "frontend-modern/src/hooks/useUnifiedResources.ts": "166e45835c56d00f1a3ddbc37f7127348a0e36dc7c42c921f972db7750c603c6"
+ "frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx": "cac90b57e94b42360989262b550c9b0beaca8dd6eecdd7f7882911bb49de9fc2",
+ "frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts": "e8ce66a9ca6ae82861a9d03a7d565f6c246f9b5fc547e7c2e64f0a3e6bd12014",
+ "frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts": "eaf519a7f205be0b0e88ea17b19552f30afef025251262a1ea1b8896442e2673",
+ "frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx": "9278ab7cf249eea451040b722b244d1447b05c07557d641187fa51f3bc88a225",
+ "frontend-modern/src/utils/alertDestinationsPresentation.ts": "5afa5dbce8eb1602377b7b27f6298438da76e3ebf2f80986677c9988bf36c96c"
},
"routes": [
- "Existing Proxmox Mail Gateway table through production REST mapper",
- "Existing storage-pool table through production adapter",
- "Existing Docker container, image, Swarm service and task tables",
- "Existing multi-disk Bars cell"
+ "Existing Alerts Notifications tab through production DestinationsTab, destination state, notification/alert API adapters and activity card, under synthetic read-only responses"
],
"viewports": [
{
- "width": 1440,
+ "width": 1365,
"height": 900
},
{
@@ -42,19 +31,18 @@
}
],
"states": [
- "PMG REST-first queue 11, canonical in-memory store hydration then newer REST queue 19, removed PMG facet withdrawn",
- "LVM-Thin and NFS plugin names; explicit shared cluster location reads Shared (3), local node remains pve2",
- "Phone container identity, State/CPU/memory/Updates remain visible; Restarts 7 reachable by touch disclosure",
- "Image phone projection keeps size and verdict; Host/Used by headers and cells hidden together",
- "Swarm raw rollback_started reads as Rollback started; every word fits phone cell and Running heading uses Run; raw rollout and placement in keyboard/touch disclosure",
- "Task started time reads as relative time on desktop with original timestamp retained; phone hides the started column",
- "Fullest measured disk label 92% with /data evidence and unchanged two equal-weight member bars"
+ "Initial attempt and held-event reads pending without an empty claim",
+ "Successful attempts do not wait for held events; refresh remains usable",
+ "Both completed empty reads establish the empty window",
+ "Independent readable attempts and held-event rows",
+ "Held-event HTTP403 clears its rows and warns, without hiding attempt evidence",
+ "Pending held retry retains the warning until success",
+ "Attempt HTTP503 clears only attempt evidence, preserving readable held rows",
+ "Both failures warn without empty claims; successful reads clear warnings"
],
"interactions": [
- "REST-first load before in-memory canonical-store hydration",
- "Canonical store hydration, newer REST refresh, removed facet refresh and restored observation",
- "Touch container row expansion, keyboard Enter on Swarm disclosure and touch service row expansion",
- "Fixture-only tab switching between production tables; no mutation clicked"
+ "Desktop keyboard Enter and phone touch refresh through the real existing Notifications tab",
+ "Partial failure, pending retry and recovery via synthetic API replies; no mutation"
],
"browsers": [
{
@@ -67,13 +55,35 @@
}
],
"playwright_version": "1.56.1",
- "checks": 40,
- "screenshots": 18,
- "command": "pulse-worker-browser frontend-modern/browser-tests/proxmox-docker-rows.cjs",
- "evidence": "browser-tests/proxmox-docker-rows.cjs and invocation browser-verified-result.json / browser-images.json",
- "limitations": [
- "Synthetic REST and canonical in-memory store hydration, not a native websocket wire or appliance test",
- "Not backend adoption, authorisation grant, mutative lifecycle execution, installed recovery or release acceptance",
- "Seven high braces advisory findings in unchanged dependency graph remain unresolved; offline browser proof does not clear required audit"
+ "checks": 20,
+ "screenshots": [
+ {
+ "path": "tmp/notification-evidence-proof/desktop-held-pending.png",
+ "sha256": "58ddaf1dae1e797e6f938c3e74b705fe75276eaf560de307fe7bfe1644c2df21"
+ },
+ {
+ "path": "tmp/notification-evidence-proof/desktop-held-unavailable.png",
+ "sha256": "fe343a2b7eb67ae1283e4eb411462073e3db26d36d226ef62d9fd49cf9a095c7"
+ },
+ {
+ "path": "tmp/notification-evidence-proof/desktop-attempts-unavailable.png",
+ "sha256": "a4ae26cc87b0bbf91b4dc3150f375a10c6701201deed4eaa3bdfbfce08ade4de"
+ },
+ {
+ "path": "tmp/notification-evidence-proof/phone-held-pending.png",
+ "sha256": "66262c32b745e68f32aba48db19dee2a03c7c62d763efd765ed4da154ec9e00f"
+ },
+ {
+ "path": "tmp/notification-evidence-proof/phone-held-unavailable.png",
+ "sha256": "534cd02e8b5392bd5e73d7f4a7a3d8e2a78596a230d055daef4479ecf0d1fdbc"
+ },
+ {
+ "path": "tmp/notification-evidence-proof/phone-attempts-unavailable.png",
+ "sha256": "09652b8023be5e527712d42384e9fee8e114575026aefaf703e62cfa30bc0884"
+ }
+ ],
+ "proof_script": "frontend-modern/browser-tests/notification-evidence.cjs",
+ "limits": [
+ "Synthetic source/UI evidence only, not notification receipt, native provider delivery, release availability or dependency advisory clearance"
]
}
diff --git a/frontend-modern/src/features/alerts/AlertDeliveryLogCard.test.tsx b/frontend-modern/src/features/alerts/AlertDeliveryLogCard.test.tsx
index 312340f152..4fb6b60f9a 100644
--- a/frontend-modern/src/features/alerts/AlertDeliveryLogCard.test.tsx
+++ b/frontend-modern/src/features/alerts/AlertDeliveryLogCard.test.tsx
@@ -273,7 +273,7 @@ describe('AlertDeliveryLogCard', () => {
expect(screen.queryByRole('list')).not.toBeInTheDocument();
});
- it('hides held rows during an outage and restores their current state on recovery', () => {
+ it('hides held rows when their own read fails and restores them on recovery', () => {
const [unavailable, setUnavailable] = createSignal(false);
const [heldEvents, setHeldEvents] = createSignal<AlertEvent[]>([
{
@@ -290,7 +290,8 @@ describe('AlertDeliveryLogCard', () => {
render(() => (
<AlertDeliveryLogCard
log={{ ...log, entries: [] }}
- unavailable={unavailable()}
+ unavailable={false}
+ heldEventsUnavailable={unavailable()}
refreshing={false}
onRefresh={vi.fn()}
webhooks={[]}
@@ -300,7 +301,9 @@ describe('AlertDeliveryLogCard', () => {
expect(screen.getByText('Deferred')).toBeInTheDocument();
setUnavailable(true);
- expect(screen.getByRole('alert')).toHaveTextContent(/could not read the delivery log/);
+ expect(screen.getByRole('alert')).toHaveTextContent(
+ /could not read held or deferred notifications/,
+ );
expect(screen.queryByRole('list')).not.toBeInTheDocument();
expect(screen.queryByText('nas-quiet (usage)')).not.toBeInTheDocument();
expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
@@ -332,4 +335,106 @@ describe('AlertDeliveryLogCard', () => {
expect(screen.getByRole('alert')).toHaveTextContent(/could not read the delivery log/);
expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
});
+ it('keeps independently readable held evidence when delivery attempts are unavailable', () => {
+ render(() => (
+ <AlertDeliveryLogCard
+ log={log}
+ unavailable={true}
+ refreshing={false}
+ heldEvents={[
+ {
+ id: 7,
+ type: 'notification_deferred',
+ alertId: 'held-known',
+ occurredAt: '2026-10-03T10:00:00Z',
+ reason: 'quiet_hours:performance',
+ },
+ ]}
+ onRefresh={vi.fn()}
+ webhooks={webhooks}
+ />
+ ));
+ expect(screen.getByRole('alert')).toHaveTextContent(/could not read the delivery log/);
+ expect(screen.getByText('held-known')).toBeInTheDocument();
+ expect(screen.getByText('Quiet hours')).toBeInTheDocument();
+ expect(screen.queryByText('Delivered')).not.toBeInTheDocument();
+ expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
+ });
+
+ it('reports missing held evidence without hiding readable attempts', () => {
+ render(() => (
+ <AlertDeliveryLogCard
+ log={log}
+ unavailable={false}
+ refreshing={false}
+ heldEventsUnavailable={true}
+ heldEvents={[
+ {
+ id: 8,
+ type: 'notification_suppressed',
+ alertId: 'stale-held',
+ occurredAt: '2026-10-03T10:00:00Z',
+ },
+ ]}
+ onRefresh={vi.fn()}
+ webhooks={webhooks}
+ />
+ ));
+ expect(screen.getByRole('alert')).toHaveTextContent(
+ /could not read held or deferred notifications/,
+ );
+ expect(screen.getByText('Delivered')).toBeInTheDocument();
+ expect(screen.getByText('Ops Discord')).toBeInTheDocument();
+ expect(screen.queryByText('stale-held')).not.toBeInTheDocument();
+ });
+
+ it('does not claim an empty activity window while held evidence is pending', () => {
+ render(() => (
+ <AlertDeliveryLogCard
+ log={{ ...log, entries: [] }}
+ unavailable={false}
+ refreshing={false}
+ refreshingHeldEvents={true}
+ onRefresh={vi.fn()}
+ webhooks={[]}
+ />
+ ));
+ expect(screen.getByRole('status')).toHaveTextContent(
+ 'Loading held and deferred notifications...',
+ );
+ expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
+ // A slow held read must not prevent a new delivery-attempt refresh.
+ expect(screen.getByRole('button', { name: 'Refresh delivery status' })).toBeEnabled();
+ });
+
+ it('does not claim an empty activity window when held evidence is unavailable', () => {
+ render(() => (
+ <AlertDeliveryLogCard
+ log={{ ...log, entries: [] }}
+ unavailable={false}
+ refreshing={false}
+ heldEventsUnavailable={true}
+ onRefresh={vi.fn()}
+ webhooks={[]}
+ />
+ ));
+ expect(screen.getByRole('alert')).toHaveTextContent(
+ /could not read held or deferred notifications/,
+ );
+ expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
+ });
+
+ it('labels the initial attempt read as loading rather than empty', () => {
+ render(() => (
+ <AlertDeliveryLogCard
+ log={null}
+ unavailable={false}
+ refreshing={true}
+ onRefresh={vi.fn()}
+ webhooks={[]}
+ />
+ ));
+ expect(screen.getByRole('status')).toHaveTextContent('Loading delivery attempts...');
+ expect(screen.queryByText(/No alert deliveries were attempted/)).not.toBeInTheDocument();
+ });
});
diff --git a/frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx b/frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx
index c11b0f8c07..b45de97225 100644
--- a/frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx
+++ b/frontend-modern/src/features/alerts/AlertDeliveryLogCard.tsx
@@ -15,6 +15,9 @@ import {
getAlertDestinationsDeliveryLogEmpty,
getAlertDestinationsDeliveryLogTitle,
getAlertDestinationsDeliveryLogUnavailable,
+ getAlertDestinationsDeliveryLogLoading,
+ getAlertDestinationsHeldEventsLoading,
+ getAlertDestinationsHeldEventsUnavailable,
getAlertDestinationsDeliveryRefreshLabel,
} from '@/utils/alertDestinationsPresentation';
import { formatRelativeTime } from '@/utils/format';
@@ -28,6 +31,8 @@ interface AlertDeliveryLogCardProps {
onRefresh: () => void;
webhooks: Webhook[];
heldEvents?: AlertEvent[];
+ heldEventsUnavailable?: boolean;
+ refreshingHeldEvents?: boolean;
}
type DeliveryLogRow =
@@ -99,10 +104,18 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
return rest.length > 0 ? `${first} +${rest.length} more` : first;
};
- const entries = () => props.log?.entries ?? [];
+ const entries = () => (props.unavailable ? [] : (props.log?.entries ?? []));
const completedRetentionDays = () => props.log?.completedRetentionDays ?? 7;
const deadLetterRetentionDays = () => props.log?.deadLetterRetentionDays ?? 30;
- const rows = () => mergeDeliveryLogRows(entries(), props.heldEvents ?? []);
+ const rows = () =>
+ mergeDeliveryLogRows(entries(), props.heldEventsUnavailable ? [] : (props.heldEvents ?? []));
+ const attemptsLoading = () => props.refreshing || (!props.log && !props.unavailable);
+ const confirmedEmpty = () =>
+ props.log !== null &&
+ !props.unavailable &&
+ !attemptsLoading() &&
+ !props.heldEventsUnavailable &&
+ !props.refreshingHeldEvents;
const absoluteTimestamp = (value: string): string => {
const parsed = new Date(value);
@@ -149,100 +162,113 @@ export function AlertDeliveryLogCard(props: AlertDeliveryLogCardProps) {
</button>
</div>
+ <Show when={props.unavailable}>
+ <p class="text-sm text-red-800 dark:text-red-300" role="alert">
+ {getAlertDestinationsDeliveryLogUnavailable()}
+ </p>
+ </Show>
+ <Show when={props.heldEventsUnavailable}>
+ <p class="text-sm text-red-800 dark:text-red-300" role="alert">
+ {getAlertDestinationsHeldEventsUnavailable()}
+ </p>
+ </Show>
+ <Show when={attemptsLoading() && entries().length === 0}>
+ <p class="text-sm text-gray-600 dark:text-gray-400" role="status">
+ {getAlertDestinationsDeliveryLogLoading()}
+ </p>
+ </Show>
+ <Show when={props.refreshingHeldEvents}>
+ <p class="text-sm text-gray-600 dark:text-gray-400" role="status">
+ {getAlertDestinationsHeldEventsLoading()}
+ </p>
+ </Show>
<Show
- when={!props.unavailable}
+ when={rows().length > 0}
fallback={
- <p class="text-sm text-red-800 dark:text-red-300" role="alert">
- {getAlertDestinationsDeliveryLogUnavailable()}
- </p>
- }
- >
- <Show
- when={rows().length > 0}
- fallback={
+ <Show when={confirmedEmpty()}>
<p class="text-sm text-gray-600 dark:text-gray-400">
{getAlertDestinationsDeliveryLogEmpty()}
</p>
- }
- >
- <ul class="max-h-80 divide-y divide-gray-200 overflow-y-auto dark:divide-gray-700">
- <For each={rows()}>
- {(row) =>
- row.kind === 'attempt' ? (
- <li class="flex flex-col gap-1 py-2">
- <div class="flex flex-wrap items-center gap-x-3 gap-y-1">
- <span
- class={`inline-flex flex-shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium ${outcomeBadgeClasses[row.entry.outcome]}`}
- >
- {getAlertDeliveryLogOutcomeLabel(row.entry.outcome)}
- </span>
- <span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
- {destinationLabel(row.entry)}
- </span>
- <span
- class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400"
- title={row.entry.alertIds.join(', ')}
- >
- {alertSummary(row.entry)}
- </span>
- <time
- class="ml-auto flex-shrink-0 text-xs text-gray-500 dark:text-gray-400"
- dateTime={row.entry.timestamp}
- title={formatRelativeTime(row.entry.timestamp)}
- >
- {absoluteTimestamp(row.entry.timestamp)}
- </time>
- </div>
- <Show
- when={
- !row.entry.success && (row.entry.failureClass || row.entry.errorMessage)
- }
+ </Show>
+ }
+ >
+ <ul class="max-h-80 divide-y divide-gray-200 overflow-y-auto dark:divide-gray-700">
+ <For each={rows()}>
+ {(row) =>
+ row.kind === 'attempt' ? (
+ <li class="flex flex-col gap-1 py-2">
+ <div class="flex flex-wrap items-center gap-x-3 gap-y-1">
+ <span
+ class={`inline-flex flex-shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium ${outcomeBadgeClasses[row.entry.outcome]}`}
+ >
+ {getAlertDeliveryLogOutcomeLabel(row.entry.outcome)}
+ </span>
+ <span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
+ {destinationLabel(row.entry)}
+ </span>
+ <span
+ class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400"
+ title={row.entry.alertIds.join(', ')}
+ >
+ {alertSummary(row.entry)}
+ </span>
+ <time
+ class="ml-auto flex-shrink-0 text-xs text-gray-500 dark:text-gray-400"
+ dateTime={row.entry.timestamp}
+ title={formatRelativeTime(row.entry.timestamp)}
+ >
+ {absoluteTimestamp(row.entry.timestamp)}
+ </time>
+ </div>
+ <Show
+ when={
+ !row.entry.success && (row.entry.failureClass || row.entry.errorMessage)
+ }
+ >
+ <p class="text-xs leading-5 text-red-700 dark:text-red-300">
+ <Show when={row.entry.failureClass}>
+ {(failureClass) => (
+ <span class="font-medium">
+ {getAlertDeliveryLogFailureClassLabel(failureClass())}
+ {row.entry.errorMessage ? ': ' : ''}
+ </span>
+ )}
+ </Show>
+ {row.entry.errorMessage}
+ </p>
+ </Show>
+ </li>
+ ) : (
+ <li class="flex flex-col gap-1 py-2" title={row.event.message}>
+ <div class="flex flex-wrap items-center gap-x-3 gap-y-1">
+ <span
+ class={`inline-flex flex-shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium ${
+ row.event.type === 'notification_deferred'
+ ? 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300'
+ : 'bg-gray-100 text-gray-600 dark:bg-gray-700/60 dark:text-gray-300'
+ }`}
+ >
+ {row.event.type === 'notification_deferred' ? 'Deferred' : 'Held'}
+ </span>
+ <span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
+ {heldResourceLabel(row.event)}
+ </span>
+ <span class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400">
+ {describeAlertEventReason(row.event.reason)}
+ </span>
+ <time
+ class="ml-auto flex-shrink-0 text-xs text-gray-500 dark:text-gray-400"
+ dateTime={row.event.occurredAt}
+ title={formatRelativeTime(row.event.occurredAt)}
>
- <p class="text-xs leading-5 text-red-700 dark:text-red-300">
- <Show when={row.entry.failureClass}>
- {(failureClass) => (
- <span class="font-medium">
- {getAlertDeliveryLogFailureClassLabel(failureClass())}
- {row.entry.errorMessage ? ': ' : ''}
- </span>
- )}
- </Show>
- {row.entry.errorMessage}
- </p>
- </Show>
- </li>
- ) : (
- <li class="flex flex-col gap-1 py-2" title={row.event.message}>
- <div class="flex flex-wrap items-center gap-x-3 gap-y-1">
- <span
- class={`inline-flex flex-shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-medium ${
- row.event.type === 'notification_deferred'
- ? 'bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-300'
- : 'bg-gray-100 text-gray-600 dark:bg-gray-700/60 dark:text-gray-300'
- }`}
- >
- {row.event.type === 'notification_deferred' ? 'Deferred' : 'Held'}
- </span>
- <span class="min-w-0 truncate text-sm font-medium text-gray-900 dark:text-gray-100">
- {heldResourceLabel(row.event)}
- </span>
- <span class="min-w-0 truncate text-sm text-gray-600 dark:text-gray-400">
- {describeAlertEventReason(row.event.reason)}
- </span>
- <time
- class="ml-auto flex-shrink-0 text-xs text-gray-500 dark:text-gray-400"
- dateTime={row.event.occurredAt}
- title={formatRelativeTime(row.event.occurredAt)}
- >
- {absoluteTimestamp(row.event.occurredAt)}
- </time>
- </div>
- </li>
- )
- }
- </For>
- </ul>
- </Show>
+ {absoluteTimestamp(row.event.occurredAt)}
+ </time>
+ </div>
+ </li>
+ )
+ }
+ </For>
+ </ul>
</Show>
</div>
</Card>
diff --git a/frontend-modern/src/features/alerts/__tests__/DestinationsTab.recoveryediting.test.tsx b/frontend-modern/src/features/alerts/__tests__/DestinationsTab.recoveryediting.test.tsx
index 2c07536cad..2d3589247e 100644
--- a/frontend-modern/src/features/alerts/__tests__/DestinationsTab.recoveryediting.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/DestinationsTab.recoveryediting.test.tsx
@@ -259,7 +259,7 @@ describe('DestinationsTab recovery while editing SMTP', () => {
).toBeInTheDocument();
expect(
await screen.findByText(
- 'Pulse could not read the delivery log, so recent delivery activity cannot be shown.',
+ 'Pulse could not read the delivery log. Refresh to check delivery attempts.',
),
).toBeInTheDocument();
expect(screen.queryByText('SMTP fixture rejected')).not.toBeInTheDocument();
diff --git a/frontend-modern/src/features/alerts/__tests__/useAlertDestinationsTabState.test.tsx b/frontend-modern/src/features/alerts/__tests__/useAlertDestinationsTabState.test.tsx
index b01d8e43b0..2515c6f393 100644
--- a/frontend-modern/src/features/alerts/__tests__/useAlertDestinationsTabState.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/useAlertDestinationsTabState.test.tsx
@@ -156,6 +156,17 @@ describe('useAlertDestinationsTabState', () => {
await Promise.resolve();
expect(result.deliveryLog()).toEqual(current);
expect(result.deliveryLogUnavailable()).toBe(false);
+ expect(result.heldEventsUnavailable()).toBe(false);
+ expect(result.refreshingHeldEvents()).toBe(false);
+ vi.mocked(AlertsAPI.getEvents).mockRejectedValueOnce(new Error('held events denied'));
+ vi.mocked(NotificationsAPI.getDeliveryLog).mockResolvedValueOnce(current);
+ await result.loadDeliveryLog();
+ expect(result.heldEvents()).toEqual([]);
+ expect(result.heldEventsUnavailable()).toBe(true);
+ expect(result.refreshingHeldEvents()).toBe(false);
+ expect(result.deliveryLogUnavailable()).toBe(false);
+ expect(result.deliveryLog()).toEqual(current);
+
expect(result.refreshingDeliveryLog()).toBe(false);
} finally {
cleanup();
diff --git a/frontend-modern/src/features/alerts/__tests__/useNotificationDeliveryLog.test.tsx b/frontend-modern/src/features/alerts/__tests__/useNotificationDeliveryLog.test.tsx
index e4398987af..ad497217a0 100644
--- a/frontend-modern/src/features/alerts/__tests__/useNotificationDeliveryLog.test.tsx
+++ b/frontend-modern/src/features/alerts/__tests__/useNotificationDeliveryLog.test.tsx
@@ -107,6 +107,8 @@ describe('useNotificationDeliveryLog', () => {
expect(state.deliveryLog()).toEqual(emptyLog);
expect(state.refreshingDeliveryLog()).toBe(false);
expect(state.heldEvents()).toEqual([]);
+ expect(state.refreshingHeldEvents()).toBe(true);
+ expect(state.heldEventsUnavailable()).toBe(false);
} finally {
held.resolve([]);
dispose();
@@ -132,6 +134,8 @@ describe('useNotificationDeliveryLog', () => {
expect(state.heldEvents()).toHaveLength(1);
await state.loadDeliveryLog();
expect(state.heldEvents()).toEqual([]);
+ expect(state.heldEventsUnavailable()).toBe(true);
+ expect(state.refreshingHeldEvents()).toBe(false);
expect(state.deliveryLog()).toEqual(emptyLog);
expect(state.deliveryLogUnavailable()).toBe(false);
expect(state.refreshingDeliveryLog()).toBe(false);
@@ -222,6 +226,8 @@ describe('useNotificationDeliveryLog', () => {
else older.reject(new Error('stale held read'));
await Promise.resolve();
expect(state.heldEvents()).toEqual(current);
+ expect(state.heldEventsUnavailable()).toBe(false);
+ expect(state.refreshingHeldEvents()).toBe(false);
} finally {
dispose();
}
@@ -264,4 +270,56 @@ describe('useNotificationDeliveryLog', () => {
expect(AlertsAPI.getEvents).toHaveBeenCalledTimes(1);
}),
);
+ it('retains the held-read warning during retry until that read succeeds', () =>
+ createRoot(async (dispose) => {
+ const recovery = deferred<Awaited<ReturnType<typeof AlertsAPI.getEvents>>>();
+ vi.mocked(NotificationsAPI.getDeliveryLog).mockResolvedValue(emptyLog);
+ vi.mocked(AlertsAPI.getEvents)
+ .mockRejectedValueOnce(new Error('permission denied'))
+ .mockReturnValueOnce(recovery.promise);
+ const state = useNotificationDeliveryLog();
+ try {
+ await state.loadDeliveryLog();
+ expect(state.heldEventsUnavailable()).toBe(true);
+ await state.loadDeliveryLog();
+ expect(state.heldEventsUnavailable()).toBe(true);
+ expect(state.refreshingHeldEvents()).toBe(true);
+ expect(state.refreshingDeliveryLog()).toBe(false);
+ recovery.resolve([]);
+ await recovery.promise;
+ expect(state.heldEventsUnavailable()).toBe(false);
+ expect(state.refreshingHeldEvents()).toBe(false);
+ } finally {
+ dispose();
+ }
+ }));
+
+ it.each(['success', 'failure'])(
+ 'keeps the newest held read pending after an older %s',
+ (outcome) =>
+ createRoot(async (dispose) => {
+ const older = deferred<Awaited<ReturnType<typeof AlertsAPI.getEvents>>>();
+ const newer = deferred<Awaited<ReturnType<typeof AlertsAPI.getEvents>>>();
+ vi.mocked(NotificationsAPI.getDeliveryLog).mockResolvedValue(emptyLog);
+ vi.mocked(AlertsAPI.getEvents)
+ .mockReturnValueOnce(older.promise)
+ .mockReturnValueOnce(newer.promise);
+ const state = useNotificationDeliveryLog();
+ try {
+ await state.loadDeliveryLog();
+ await state.loadDeliveryLog();
+ if (outcome === 'success') older.resolve([]);
+ else older.reject(new Error('stale denied request'));
+ await Promise.resolve();
+ expect(state.refreshingHeldEvents()).toBe(true);
+ expect(state.heldEventsUnavailable()).toBe(false);
+ newer.resolve([]);
+ await newer.promise;
+ expect(state.refreshingHeldEvents()).toBe(false);
+ expect(state.heldEventsUnavailable()).toBe(false);
+ } finally {
+ dispose();
+ }
+ }),
+ );
});
diff --git a/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx b/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
index 3f2e0f7718..d6462cefe9 100644
--- a/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
+++ b/frontend-modern/src/features/alerts/tabs/DestinationsTab.tsx
@@ -102,6 +102,8 @@ export function DestinationsTab(props: DestinationsTabProps) {
onRefresh={() => void state.loadDeliveryLog()}
webhooks={state.webhooks()}
heldEvents={state.heldEvents()}
+ heldEventsUnavailable={state.heldEventsUnavailable()}
+ refreshingHeldEvents={state.refreshingHeldEvents()}
/>
<Show when={state.hasLoadError()}>
diff --git a/frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts b/frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts
index 26d815d52c..86c90f37f1 100644
--- a/frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts
+++ b/frontend-modern/src/features/alerts/useAlertDestinationsTabState.ts
@@ -53,6 +53,8 @@ export function useAlertDestinationsTabState(props: AlertDestinationsTabStatePro
deliveryLogUnavailable,
refreshingDeliveryLog,
heldEvents,
+ heldEventsUnavailable,
+ refreshingHeldEvents,
loadDeliveryLog,
} = useNotificationDeliveryLog();
const webhookState = useAlertWebhookDestinationsState({
@@ -173,6 +175,8 @@ export function useAlertDestinationsTabState(props: AlertDestinationsTabStatePro
deliveryLogUnavailable,
deliveryNeedsAttention,
heldEvents,
+ heldEventsUnavailable,
+ refreshingHeldEvents,
dismissTerminalFailures,
dismissingTerminalFailures,
handleRetry,
diff --git a/frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts b/frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts
index 1ddceb830f..e36c6036df 100644
--- a/frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts
+++ b/frontend-modern/src/features/alerts/useNotificationDeliveryLog.ts
@@ -19,12 +19,15 @@ const DELIVERY_LOG_LIMIT = 200;
// Held events are the third half of that story: notifications that were
// deliberately not attempted, with the mechanism that held them. They come
// from the alert event log and degrade independently — a failed events read
-// hides the held rows without marking delivery attempts unavailable.
+// withdraws the held rows and reports that gap without hiding readable attempts.
export function useNotificationDeliveryLog() {
const [deliveryLog, setDeliveryLog] = createSignal<NotificationDeliveryLog | null>(null);
const [deliveryLogUnavailable, setDeliveryLogUnavailable] = createSignal(false);
const [refreshingDeliveryLog, setRefreshingDeliveryLog] = createSignal(false);
const [heldEvents, setHeldEvents] = createSignal<AlertEvent[]>([]);
+ const [heldEventsUnavailable, setHeldEventsUnavailable] = createSignal(false);
+ // Before the first read, an empty array means unknown, not no held alerts.
+ const [refreshingHeldEvents, setRefreshingHeldEvents] = createSignal(true);
// Both reads belong to the same refresh, but held events never block the log.
let latestRequest = 0;
@@ -35,6 +38,7 @@ export function useNotificationDeliveryLog() {
const ownsRequest = (request: number) => !disposed && request === latestRequest;
const loadHeldEvents = async (request: number) => {
+ setRefreshingHeldEvents(true);
try {
const since = new Date(
Date.now() - HELD_EVENT_WINDOW_DAYS * 24 * 60 * 60 * 1000,
@@ -44,11 +48,16 @@ export function useNotificationDeliveryLog() {
since,
limit: HELD_EVENT_LIMIT,
});
- if (ownsRequest(request)) setHeldEvents(events);
+ if (!ownsRequest(request)) return;
+ setHeldEvents(events);
+ setHeldEventsUnavailable(false);
} catch (error) {
if (!ownsRequest(request)) return;
logger.error('Failed to load held alert notification events', error);
setHeldEvents([]);
+ setHeldEventsUnavailable(true);
+ } finally {
+ if (ownsRequest(request)) setRefreshingHeldEvents(false);
}
};
@@ -82,6 +91,8 @@ export function useNotificationDeliveryLog() {
deliveryLogUnavailable,
refreshingDeliveryLog,
heldEvents,
+ heldEventsUnavailable,
+ refreshingHeldEvents,
loadDeliveryLog,
};
}
diff --git a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
index 839f7bc178..8cf26ffba5 100644
--- a/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/alertDestinationsPresentation.test.ts
@@ -35,6 +35,9 @@ import {
getAlertDestinationsDeliveryLogEmpty,
getAlertDestinationsDeliveryLogTitle,
getAlertDestinationsDeliveryLogUnavailable,
+ getAlertDestinationsDeliveryLogLoading,
+ getAlertDestinationsHeldEventsLoading,
+ getAlertDestinationsHeldEventsUnavailable,
getAlertDestinationsTestPausedWarning,
getAlertDestinationsAppriseTargetsHelp,
getAlertDestinationsAppriseTestLabel,
@@ -267,6 +270,28 @@ describe('alert destinations delivery log copy', () => {
);
});
+ it('distinguishes pending and unavailable activity sources without implying delivery failure', () => {
+ expect(getAlertDestinationsDeliveryLogLoading()).toBe('Loading delivery attempts...');
+ expect(getAlertDestinationsHeldEventsLoading()).toBe(
+ 'Loading held and deferred notifications...',
+ );
+ expect(getAlertDestinationsHeldEventsUnavailable()).toBe(
+ 'Pulse could not read held or deferred notifications. Refresh to try again.',
+ );
+ expect(getAlertDestinationsDeliveryLogUnavailable()).toBe(
+ 'Pulse could not read the delivery log. Refresh to check delivery attempts.',
+ );
+ for (const message of [
+ getAlertDestinationsDeliveryLogLoading(),
+ getAlertDestinationsHeldEventsLoading(),
+ getAlertDestinationsHeldEventsUnavailable(),
+ getAlertDestinationsDeliveryLogUnavailable(),
+ ]) {
+ expect(message).not.toContain('No alert deliveries');
+ expect(message).not.toContain('not delivered');
+ }
+ });
+
it('warns that a passing test does not mean live alerts flow while delivery is paused', () => {
const warning = getAlertDestinationsTestPausedWarning();
expect(warning).toContain('Test sent');
diff --git a/frontend-modern/src/utils/alertDestinationsPresentation.ts b/frontend-modern/src/utils/alertDestinationsPresentation.ts
index 92ad797dc7..1fc3454103 100644
--- a/frontend-modern/src/utils/alertDestinationsPresentation.ts
+++ b/frontend-modern/src/utils/alertDestinationsPresentation.ts
@@ -277,7 +277,19 @@ export const ALERT_DESTINATIONS_DELIVERY_LOG_TITLE = 'Recent delivery activity';
export const ALERT_DESTINATIONS_DELIVERY_LOG_EMPTY =
'No alert deliveries were attempted in this window.';
export const ALERT_DESTINATIONS_DELIVERY_LOG_UNAVAILABLE =
- 'Pulse could not read the delivery log, so recent delivery activity cannot be shown.';
+ 'Pulse could not read the delivery log. Refresh to check delivery attempts.';
+
+export function getAlertDestinationsHeldEventsUnavailable() {
+ return 'Pulse could not read held or deferred notifications. Refresh to try again.';
+}
+
+export function getAlertDestinationsDeliveryLogLoading() {
+ return 'Loading delivery attempts...';
+}
+
+export function getAlertDestinationsHeldEventsLoading() {
+ return 'Loading held and deferred notifications...';
+}
export function getAlertDestinationsDeliveryLogTitle() {
return ALERT_DESTINATIONS_DELIVERY_LOG_TITLE;