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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Dispose role confirmations without stale reactive reads
pulse-triage[bot]4baea07b11a5
diff --git a/frontend-modern/src/components/Settings/RolesPanel.tsx b/frontend-modern/src/components/Settings/RolesPanel.tsxindex 741340faa8..c7406886f2 100644--- a/frontend-modern/src/components/Settings/RolesPanel.tsx+++ b/frontend-modern/src/components/Settings/RolesPanel.tsx@@ -177,20 +177,20 @@ export const RolesPanel: Component<RolesPanelProps> = (props) => {onSave={state.handleSaveRole}onUpdatePermission={state.updatePermission}/>- <Show when={state.rolePendingDeletion()}>+ <Show keyed when={state.rolePendingDeletion()}>{(role) => (<DialogisOpen={true}onClose={state.closeDeleteRole}closeOnBackdrop={false}panelClass="max-w-lg"- ariaLabel={`Delete role: ${role().name}`}+ ariaLabel={`Delete role: ${role.name}`}><div class="space-y-5 p-6"><div><h3 class="text-lg font-semibold text-base-content">Delete role?</h3><p class="mt-2 text-sm text-muted">- Are you sure you want to delete the role "{role().name}"?+ Are you sure you want to delete the role "{role.name}"?</p></div><Show when={state.actionError()}>diff --git a/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx b/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsxindex f6fd52a4ca..7d39164544 100644--- a/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/RolesReaderLifetime.test.tsx@@ -1,6 +1,6 @@import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';-import { createSignal } from 'solid-js';+import { createSignal, ErrorBoundary, Show } from 'solid-js';import { createStore } from 'solid-js/store';import { eventBus } from '@/stores/events';import { useRolesPanelState } from '../useRolesPanelState';@@ -348,6 +348,32 @@ describe('Roles reader lifetime', () => {expect(mocks.error).not.toHaveBeenCalled();});+ it('disposes an open confirmation without reading a stale Show accessor', async () => {+ const [visible, setVisible] = createSignal(true);+ const errors = vi.fn();+ render(() => (+ <ErrorBoundary+ fallback={(error) => {+ errors(error);+ return <p>Boundary failure</p>;+ }}+ >+ <Show when={visible()}>+ <RolesPanel currentUser="reader-a" canManage={visible()} />+ </Show>+ </ErrorBoundary>+ ));+ fireEvent.click(await screen.findByRole('button', { name: 'Delete role' }));+ expect(+ await screen.findByRole('dialog', { name: 'Delete role: North private role' }),+ ).toBeInTheDocument();+ setVisible(false);+ await pause();+ expect(errors).not.toHaveBeenCalled();+ expect(screen.queryByRole('dialog')).not.toBeInTheDocument();+ expect(mocks.deleteRole).not.toHaveBeenCalled();+ });+it('keeps unlisted saved permission strings visible and unchanged in the real editor', async () => {mocks.getRoles.mockResolvedValueOnce([{ ...north, permissions: [{ action: 'future:read', resource: 'future/*' }] },diff --git a/frontend-modern/src/components/Settings/useRolesPanelState.ts b/frontend-modern/src/components/Settings/useRolesPanelState.tsindex 43780cdb02..d7cdfad525 100644--- a/frontend-modern/src/components/Settings/useRolesPanelState.ts+++ b/frontend-modern/src/components/Settings/useRolesPanelState.ts@@ -153,8 +153,8 @@ export function useRolesPanelState(props: RolesPanelProps = {}) {mutationController?.abort();readController = mutationController = undefined;// A new object also invalidates operations when returning to the same reader.- setContext({ org: currentOrg(), user: props.currentUser, allowed: accessAllowed() });batch(() => {+ setContext({ org: currentOrg(), user: props.currentUser, allowed: accessAllowed() });clearEditor();setRoles([]);setRolePendingDeletion(null);