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.

Require a current destination for retained sharing drafts

pulse-triage[bot]59798e713276
diff --git a/frontend-modern/browser-verification/0c0083d45f252c00.json b/frontend-modern/browser-verification/0c0083d45f252c00.json
new file mode 100644
index 0000000000..7e29f729ea
--- /dev/null
+++ b/frontend-modern/browser-verification/0c0083d45f252c00.json
@@ -0,0 +1,64 @@
+{
+ "version": 1,
+ "base_sha": "e0a1fc5f16d01ae002269ca533914185d306b9ac",
+ "verified_at": "2026-10-31T19:37:09.409Z",
+ "result": "passed",
+ "changed_paths": [
+ "frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts"
+ ],
+ "content_sha256": {
+ "frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts": "06e4e885f74867396cce4fcf1fb96e16c25c78fad681961587610618d09fce59"
+ },
+ "routes": [
+ "Existing Organization Sharing settings, production state/panel/API client/unified resources/styles with synthetic local HTTP/WS producers"
+ ],
+ "viewports": [
+ {
+ "width": 1440,
+ "height": 1050
+ },
+ {
+ "width": 320,
+ "height": 900
+ }
+ ],
+ "states": [
+ "Selected sharing unavailable and pending reload, not prior-org rows or false empty",
+ "Accepted current sharing and accepted empty lists",
+ "Unconfirmed write requires read reconciliation",
+ "Read-only and non-manager sessions without changes",
+ "Interrupted writes/obsolete reads cannot replace current context or draft",
+ "Unavailable quick pick is inert",
+ "A removed destination requires explicit reselection, never an invisible retained value or automatic replacement"
+ ],
+ "interactions": [
+ "Read-only keyboard/touch reload, same-selection draft preservation and cross-selection clearing",
+ "All four existing share actions via real grid rows, including accepted incoming removal",
+ "Refused writes are not retried; late reads/writes cannot cross organization or principal",
+ "Capability loss/return and explicit default scope",
+ "Resource disappearance disables creation; destination disappearance clears the target; only an explicit new target permits the next share"
+ ],
+ "browsers": [
+ {
+ "engine": "Chromium",
+ "version": "141.0.7390.37"
+ },
+ {
+ "engine": "WebKit",
+ "version": "26.0"
+ }
+ ],
+ "playwright_version": "1.56.1",
+ "checks": 58,
+ "captures": 18,
+ "pixel_review": "All 18 final captures opened with native view_image, desktop and 320px. Inline notices/destination reselection are readable; existing grids scroll horizontally. Toast-overlap limitations retained in detailed pixels.",
+ "evidence": [
+ "RECEIPTS.md",
+ "BROWSER-SUMMARY.json",
+ "PIXEL-REVIEW.json",
+ "CURRENT.tar.xz",
+ "final-captures/browser-result.json",
+ "final-remaining/browser-result.json"
+ ],
+ "limitations": "Safe fixtures, not published customer relief or original private/native recovery. The partial manual-helper timing failure remains retained; only missing proof continued afterwards."
+}
diff --git a/frontend-modern/src/components/Settings/__tests__/OrganizationSharingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/OrganizationSharingPanel.test.tsx
index 535db29d71..66c19588aa 100644
--- a/frontend-modern/src/components/Settings/__tests__/OrganizationSharingPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/OrganizationSharingPanel.test.tsx
@@ -618,6 +618,27 @@ describe('sharing read admission and recovery', () => {
expect(state.targetOrgId()).toBe('org-a');
});
+ it('requires a new destination when a retained target disappears instead of silently choosing a peer', async () => {
+ const { state } = renderState();
+ await accepted(state);
+ state.applyResourceQuickPick('vm::vm-100');
+ expect(state.targetOrgId()).toBe('org-b');
+ listOrgsMock.mockResolvedValue([
+ baseOrg,
+ { ...targetOrg, id: 'org-c', displayName: 'Organization C' },
+ ]);
+ await state.loadSharingData();
+ expect(state.targetOrgId()).toBe('');
+ expect(state.canCreateShare()).toBe(false);
+ state.updateTargetOrg('org-b');
+ await state.createShare();
+ expect(createShareMock).not.toHaveBeenCalled();
+ state.updateTargetOrg('org-c');
+ await state.createShare();
+ expect(createShareMock).toHaveBeenCalledTimes(1);
+ expect(createShareMock.mock.calls[0][1].targetOrgId).toBe('org-c');
+ });
+
it('ignores a late failure without suppressing current actions or emitting a stale error', async () => {
const old = deferred<typeof baseOrg>();
orgGetMock.mockReturnValueOnce(old.promise);
diff --git a/frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts b/frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts
index a5e6c0ee87..1d6f4698aa 100644
--- a/frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts
+++ b/frontend-modern/src/components/Settings/useOrganizationSharingPanelState.ts
@@ -121,7 +121,9 @@ export function useOrganizationSharingPanelState(props: OrganizationSharingPanel
normalizeCanonicalResourceTypeInput(resourceType()),
);
const normalizedResourceId = createMemo(() => resourceId().trim());
- const hasTargetOrg = createMemo(() => targetOrgId().trim() !== '');
+ const hasTargetOrg = createMemo(() =>
+ targetOrgOptions().some((candidate) => candidate.id === targetOrgId().trim()),
+ );
// Match the complete opaque resource ID rather than splitting on a delimiter
// that may occur inside it. A removed quick pick is not a valid manual draft.
const selectedResource = createMemo(() =>
@@ -240,8 +242,14 @@ export function useOrganizationSharingPanelState(props: OrganizationSharingPanel
setOrgs(allOrgs);
setOutgoingShares(outgoing);
setIncomingShares(incoming);
- const firstTarget =
- targetOrgId().trim() || allOrgs.find((candidate) => candidate.id !== orgId)?.id || '';
+ const draftTarget = targetOrgId().trim();
+ // If a previously chosen destination disappeared, require a new choice
+ // rather than retaining an invisible value or choosing a different org.
+ const firstTarget = draftTarget
+ ? allOrgs.some((candidate) => candidate.id === draftTarget && candidate.id !== orgId)
+ ? draftTarget
+ : ''
+ : allOrgs.find((candidate) => candidate.id !== orgId)?.id || '';
setTargetOrgId(firstTarget);
setTargetOrgError(firstTarget === '' ? getOrganizationShareTargetOrgRequiredMessage() : '');
});
@@ -373,7 +381,8 @@ export function useOrganizationSharingPanelState(props: OrganizationSharingPanel
);
}
- if (!nextTargetOrgId) {
+ if (!nextTargetOrgId || !hasTargetOrg()) {
+ setTargetOrgError(getOrganizationShareTargetOrgRequiredMessage());
notificationStore.error(getOrganizationShareTargetOrgRequiredMessage());
return;
}