@@ -45,7 +45,6 @@ import {
4545 managedTunnelStartupAction ,
4646 retryManagedTunnelRegistration ,
4747} from "./managedTunnelStartup.ts" ;
48- import { shouldRetryCloudLink } from "./relayResponse.ts" ;
4948import * as ManagedEndpointRuntime from "./ManagedEndpointRuntime.ts" ;
5049
5150const unusedSecretStoreOperation = ( ) => Effect . die ( "unused secret-store operation" ) ;
@@ -109,10 +108,7 @@ describe("reconcileDesiredCloudLink", () => {
109108 const link = yield * CloudLink . CloudLink ;
110109 const error = yield * Effect . flip ( link . reconcileDesiredLink ( "http://127.0.0.1:3774" ) ) ;
111110
112- expect ( error ) . toMatchObject ( {
113- _tag : "EnvironmentHttpUnauthorizedError" ,
114- message : "Run `t3 connect link` to authorize this environment." ,
115- } ) ;
111+ expect ( error . _tag ) . toBe ( "CloudLinkAuthorizationMissingError" ) ;
116112 } ) . pipe (
117113 Effect . provide ( CloudLink . layer ) ,
118114 Effect . provideService ( HttpServer . HttpServer , idleHttpServer ) ,
@@ -689,7 +685,7 @@ describe("releaseManagedTunnelOnShutdown", () => {
689685 link
690686 . registerManagedTunnelRecovery ( localOrigin )
691687 . pipe ( Effect . tapError ( ( ) => Deferred . succeed ( firstFailure , undefined ) ) ) ,
692- shouldRetryCloudLink ,
688+ CloudLink . shouldRetryCloudLink ,
693689 link
694690 . startManagedTunnelIfOriginConfirmed ( localOrigin , {
695691 requireConfirmedOrigin : false ,
@@ -1051,10 +1047,10 @@ describe("releaseManagedTunnelOnShutdown", () => {
10511047 } ) ;
10521048
10531049 it . effect . each ( [
1054- { status : 401 , errorTag : "EnvironmentHttpUnauthorizedError " } ,
1055- { status : 403 , errorTag : "EnvironmentHttpForbiddenError " } ,
1056- { status : 409 , errorTag : "EnvironmentHttpBadRequestError " } ,
1057- ] ) ( "preserves a permanent $status relay recovery failure" , ( { status, errorTag } ) => {
1050+ { status : 401 , rejection : "unauthorized " } ,
1051+ { status : 403 , rejection : "forbidden " } ,
1052+ { status : 409 , rejection : "rejected " } ,
1053+ ] ) ( "preserves a permanent $status relay recovery failure" , ( { status, rejection } ) => {
10581054 const { store } = makeMemorySecretStore ( [
10591055 [ CLOUD_ENDPOINT_RUNTIME_CONFIG , "old-config" ] ,
10601056 [ RELAY_URL_SECRET , "https://relay.example.test" ] ,
@@ -1068,7 +1064,8 @@ describe("releaseManagedTunnelOnShutdown", () => {
10681064 const link = yield * CloudLink . CloudLink ;
10691065 const error = yield * Effect . flip ( link . recoverManagedTunnel ( "http://127.0.0.1:3773" ) ) ;
10701066
1071- expect ( error . _tag ) . toBe ( errorTag ) ;
1067+ expect ( error ) . toMatchObject ( { _tag : "RelayRequestError" , rejection } ) ;
1068+ expect ( CloudLink . shouldRetryCloudLink ( error ) ) . toBe ( false ) ;
10721069 expect ( requests ) . toHaveLength ( 1 ) ;
10731070 expect ( applyConfigCalls ) . toEqual ( [ ] ) ;
10741071 } ) . pipe (
0 commit comments