Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(connect): show why relay unlink failed #25198

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 16 commits intomain fromrefs/pull/25198/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 7 changed files with 77 additions and 7 deletions (loading 4).

x
0 of 7 viewed, 7 left
46 additions and 1 deletionapps/web/src/cloud/linkEnvironment.test.tsModified
View file
@@ -26,7 +26,7 @@
import { layerRemoteHttpClient } from "@t3tools/client-runtime/rpc";
import { __resetDesktopPrimaryAuthForTests } from "../environments/primary/desktopAuth";
​
-import { readCloudLinkState } from "./linkEnvironment";
+import { readCloudLinkState, unlinkEnvironmentFromCloud } from "./linkEnvironment";
​
const TARGET = {
environmentId: "environment-1",
@@ -239,4 +239,49 @@
}),
+​
+ it.effect("reports why the relay kept the environment after a local unlink", () =>
+ Effect.gen(function* () {
+ const fetchMock = vi.fn((input: RequestInfo | URL) =>
+ Promise.resolve(
+ String(input).startsWith("https://relay.example.test/")
+ ? Response.json(
+ {
+ _tag: "RelayInternalError",
+ code: "internal_error",
+ reason: "upstream_unavailable",
+ traceId: "trace-unlink",
+ },
+ { status: 500 },
+ )
+ : Response.json({ ok: true, endpointRuntimeStatus: null }),