fix: Proxmox v1.2.2 — client retrieval, AI message ordering, Remotes UX, Ceph false positive #124
No reviewers
Labels
No Label
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sarman/tftsr-devops_investigation#124
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/proxmox-v1.2.2-consolidated"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
clusters.get()pattern removed, newget_proxmox_client_for_cluster()call never inserted). Fixed all functions + two bugs in the new helper itself (clustersundeclared in early-return block,client_arcout of scope before return). This unblocks VMs, Storage, Tasks, Notes, Views, Certificates, Network, Administration, and other pages.systemrole touserrole....) and plug button — replaced toast-only placeholders with a functional ActionsMenu dropdown (Edit / Test Connection / Delete) and real connect/disconnect logic. Status now correctly reflects backendClusterInfoWithHealth.connectedinstead of hardcodingconnected.HEALTH_OK.Test plan
...on a remote → dropdown with Edit, Test Connection, Deletecargo test→ 416 passed, 0 failednpm run test:run→ 386 passed, 0 failednpx tsc --noEmit→ zero errorsnpx eslint . --max-warnings 0→ zero warningsAutomated PR Review (qwen3.5-122b-think via liteLLM):\n\n
Summary
This PR addresses critical Proxmox backend functionality by introducing a centralized client retrieval helper, fixes AI chat message ordering for LLM compatibility, adds functional remote management UI, and corrects Ceph health reporting. The changes are substantial and touch multiple layers (Rust backend, TypeScript frontend).
Findings
[WARNING] src/pages/Proxmox/RemotesPage.tsx:203-217 -
handleConnectRemotedoes not actually test the Proxmox connectionEvidence:
The function only checks if the cluster exists in the database, not if the Proxmox API is reachable. Status is set to 'connected' based on database presence, not actual connectivity.
[WARNING] src-tauri/src/commands/proxmox.rs:219-264 - Race condition in
get_proxmox_client_for_cluster()Evidence:
Two concurrent requests for an uncached cluster could both create and authenticate clients, with the second overwriting the first. This causes unnecessary authentication overhead.
[SUGGESTION] src/components/Proxmox/RemotesList.tsx:32-42 - Event listener cleanup may not work correctly
Evidence:
The cleanup function runs on every
openchange, but the listener was only added whenopenis true. Whenopenbecomes false, the cleanup removes a listener that may not exist.[SUGGESTION] src/pages/Proxmox/RemotesPage.tsx:139-151 - Edit operation has data loss risk
Evidence:
If
addProxmoxClusterfails afterremoveProxmoxClustersucceeds, the remote is permanently lost. The comment acknowledges this as a "known limitation" but it's a significant UX risk.Verdict: APPROVE WITH COMMENTS
The core functionality is sound and the fixes address real issues. The connection status misleading users and the race condition in client pooling should be addressed in follow-up work. The edit operation risk is documented but should ideally be mitigated with atomic transactions or a proper update endpoint.
All four findings addressed and pushed to PR #124. Here's what was done for each:
[WARNING] Fake connection test — handleConnectRemote now calls pingProxmoxCluster, a new Tauri command that authenticates and issues GET /api2/json/version against the live Proxmox API. A DB-only lookup can no longer
produce a false 'connected' status.
[WARNING] Race condition in get_proxmox_client_for_cluster — after creating and authenticating a new client, we now re-check the pool under the write lock before inserting. If a concurrent task already stored a client,
we return the existing one and discard ours, eliminating redundant auth calls and the overwrite.
[SUGGESTION] Edit data loss risk — handleEditRemote now calls updateProxmoxCluster, a new Tauri command that issues a single UPDATE statement (and evicts the stale in-memory client). There is no window where the record
is absent.
[SUGGESTION] Event listener cleanup ambiguity — the useEffect in ActionsMenu now uses an empty dependency array so the listener is always attached once on mount and always removed on unmount, with no conditional
branching to reason about.
Final counts: 420 Rust tests, 386 frontend tests, zero failures. tsc + eslint + clippy all clean.
Automated PR Review (qwen3.5-122b-think via liteLLM):\n\n
Summary
This PR fixes critical Proxmox backend functionality by introducing a centralized client retrieval helper, corrects AI chat message ordering for LLM compatibility, adds functional remote management UI, and fixes Ceph health reporting. The changes address real issues from previous iterations.
Findings
[WARNING] src/pages/Proxmox/CephPage.tsx:27-35 - Ceph availability check may produce false negatives
Evidence:
If Ceph is enabled but temporarily unreachable (network issue, high load, service restarting), the error handler sets
isCephEnabled(false)which displays "Ceph is not configured" message. This misleads users about actual cluster configuration state.Fix: Separate connection errors from configuration errors. Only set
isCephEnabled(false)if the API explicitly returns "Ceph not enabled" response, not on generic network errors.[SUGGESTION] src/components/Proxmox/RemotesList.tsx:32-42 - Event listener cleanup may be overly broad
Evidence:
The cleanup function always removes the listener, but the listener is only added once on mount. If the component unmounts while the menu is open, the cleanup will try to remove a listener that may not exist anymore.
Fix: Add conditional check in cleanup or track whether listener was added.
Verdict: APPROVE WITH COMMENTS
The core functionality is solid and addresses real bugs. The Ceph error handling could mislead users in edge cases but won't cause data loss. The event listener issue is minor and won't cause crashes. Both are acceptable for follow-up refinement.