From 5fc53948c6495242be5f5fd6dd512ec15905c2f2 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Mon, 17 Aug 2026 11:36:00 -0400 Subject: [PATCH] Treat an ACTIVE partnership as phase 2 regardless of the flags HOST_PHASE*_DONE only ever describe the mirror, so on the mirror the owner's card computed phase 0 and offered to onboard the host that had just onboarded it. --- Plugin/unraid/include/partnership.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Plugin/unraid/include/partnership.php b/Plugin/unraid/include/partnership.php index 11dc26a..f8c2a7f 100644 --- a/Plugin/unraid/include/partnership.php +++ b/Plugin/unraid/include/partnership.php @@ -371,6 +371,17 @@ function vv_pt_nodes(): array { $nodeIdUpper = strtoupper($slot); $onboardPhase = ($setupDb[$nodeIdUpper . '_PHASE2_DONE'] ?? '') === 'true' ? 2 : (($setupDb[$nodeIdUpper . '_PHASE1_DONE'] ?? '') === 'true' ? 1 : 0); + + // An ACTIVE partnership means phase 2, whatever the flags say. HOST_PHASE*_DONE always + // describe the MIRROR — they are the owner's record of how far it got provisioning the + // other side — so the owner's own slot has no such flag and never will. On the mirror + // that left the owner's card computing phase 0 and rendering "Not provisioned · SSH keys + // not installed", complete with an ▶ Onboard button, on the very host that had just + // finished onboarding it. The state file is the authority on whether a partnership + // exists; the flags only say who did what to whom. + if ($onboardPhase < 2 && ($ptDb['state'] ?? '') === 'ACTIVE') { + $onboardPhase = 2; + } // key_ready: local key generated but not yet installed on HOST2 (SSH pending manual step) $keyReady = !$isMe && ($setupDb[$nodeIdUpper . '_KEY_READY'] ?? '') === 'true'; // For self: local setup complete flag (set by partnership_manager --onboard --local-only)