Merge pull request #1189 from Molecule-AI/fix/peers-fetch-online-only

fix(canvas): skip /registry/:id/peers 401 noise on non-online workspaces
This commit is contained in:
Hongming Wang 2026-04-20 17:38:47 -07:00 committed by GitHub
commit 421d220106

View File

@ -58,8 +58,19 @@ export function DetailsTab({ workspaceId, data }: Props) {
}, [workspaceId]);
useEffect(() => {
// The /registry/:id/peers endpoint requires a workspace-scoped
// bearer token (validateDiscoveryCaller) which the canvas session
// doesn't hold. For a still-provisioning or failed workspace there
// are no peers to show anyway — skip the fetch so the Details tab
// doesn't flood devtools with 401 noise and so the empty Peers
// section renders cleanly.
if (data.status !== "online" && data.status !== "degraded") {
setPeers([]);
setPeersError(null);
return;
}
loadPeers();
}, [loadPeers]);
}, [loadPeers, data.status]);
const handleSave = async () => {
setSaving(true);