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)