Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(connect): reboots no longer strand the relay link, 403s now say why #4988

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/4988/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 6 changed files with 37 additions and 3 deletions (loading 3).

x
0 of 6 viewed, 6 left
8 additions and 1 deletionapps/mobile/src/features/cloud/linkEnvironment.tsModified
View file
@@ -134,7 +134,14 @@
case "RelayEnvironmentLinkProofInvalidError":
return `Relay rejected the environment link proof (${error.reason}).`;
case "RelayEnvironmentConnectNotAuthorizedError":
- return "Relay rejected the environment connection request.";
+ // "Not authorized" covers non-auth causes too; surface the reason so a
+ // missing link doesn't read as a credential problem.
+ if (error.reason === "environment_link_not_found") {
+ return "Relay has no active link for this environment. The environment server may not have re-established its link yet.";
+ }
+ return error.reason
+ ? `Relay rejected the environment connection request (${error.reason}).`
+ : "Relay rejected the environment connection request.";
case "RelayEnvironmentEndpointUnavailableError":
return `Relay could not reach the environment endpoint (${error.reason}).`;
case "RelayEnvironmentEndpointTimedOutError":
21 additions and 1 deletionapps/server/src/server.tsModified
View file
@@ -1,6 +1,8 @@
import { EnvironmentHttpApi } from "@t3tools/contracts";
+import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
+import * as Schedule from "effect/Schedule";
import { FetchHttpClient, HttpRouter, HttpServer } from "effect/unstable/http";
import * as HttpApiBuilder from "effect/unstable/httpapi/HttpApiBuilder";
​
@@ -535,7 +537,25 @@