MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / handleCheck

Function handleCheck

packages/react/src/components/accounts-section.tsx:181–209  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179 const missingOAuthScopes = connection.missingOAuthScopes ?? [];
180
181 const handleCheck = async () => {
182 if (checking) return;
183 setChecking(true);
184 const exit = await runCheck();
185 setChecking(false);
186 if (Exit.isFailure(exit)) {
187 toast.error(messageFromExit(exit, "Health check failed"));
188 return;
189 }
190 // The hook already folded the fresh probe into the live state.
191 if (exit.value.status === "healthy") {
192 toast.success(
193 exit.value.identity ? `Healthy: ${exit.value.identity}` : "Connection is healthy",
194 );
195 } else if (exit.value.status === "expired") {
196 toast.error("Connection expired, reconnect to restore access");
197 } else if (exit.value.status === "misconfigured") {
198 // NOT a reconnect prompt: the credential is fine; the upstream API is
199 // disabled where the OAuth client lives. The detail carries the
200 // provider's own instruction (with a console link for Google).
201 toast.warning(
202 exit.value.detail ?? "An upstream API is disabled for this connection's OAuth client",
203 );
204 } else if (exit.value.status === "degraded") {
205 toast.warning(exit.value.detail ?? "Connection check returned an error");
206 } else {
207 toast.message("No health check is configured for this integration");
208 }
209 };
210
211 return (
212 <CardStackEntry className="flex-wrap items-start">

Callers 1

AccountRowFunction · 0.70

Calls 3

messageFromExitFunction · 0.90
errorMethod · 0.80
messageMethod · 0.45

Tested by

no test coverage detected