Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client-runtime): returning to the app no longer restarts the reconnect backoff for an unreachable host #24064

ClosedBatuhan1999(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/24064/headopened View on GitHub

Showing 2 changed files with 96 additions and 19 deletions.

x
0 of 2 viewed, 2 left
72 additions and 0 deletionspackages/client-runtime/src/connection/supervisor.test.tsModified
View file
@@ -1,9 +1,11 @@
import { AuthStandardClientScopes, EnvironmentId, type ServerConfig } from "@t3tools/contracts";
import { describe, expect, it } from "@effect/vitest";
+import * as Clock from "effect/Clock";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
+import * as Queue from "effect/Queue";
import * as Random from "effect/Random";
import * as Ref from "effect/Ref";
import * as Stream from "effect/Stream";
@@ -615,6 +617,76 @@
}).pipe(Effect.provide(TestClock.layer())),
​
+ it.effect.each([
+ "application-active",
+ "application-active-probe",
+ "application-active-reconnect",
+ ] as const)("retries at once on %s but keeps climbing the ladder", (reason) =>
+ Effect.gen(function* () {
+ const attempts = yield* Queue.unbounded<number>();
+ const harness = yield* makeHarness({
+ prepare: (attempt) =>
+ Queue.offer(attempts, attempt).pipe(
+ Effect.andThen(Effect.fail(transient("Could not resolve hostname."))),
+ ),
+ });
+ const supervisor = yield* EnvironmentSupervisor.make(TARGET_ENTRY, {