Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): stop stale turn setup and bound completion delivery retries #15311

ClosedAdamulek123(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/15311/headopened View on GitHub

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

x
0 of 6 viewed, 6 left
102 additions and 0 deletionsapps/server/src/orchestration-v2/ProviderContinuationService.test.tsModified
View file
@@ -9,8 +9,10 @@
type OrchestrationV2Notification,
} from "@t3tools/contracts";
import * as Deferred from "effect/Deferred";
+import * as Cause from "effect/Cause";
import * as DateTime from "effect/DateTime";
import * as Effect from "effect/Effect";
+import * as Exit from "effect/Exit";
import * as Layer from "effect/Layer";
import * as Option from "effect/Option";
import * as Queue from "effect/Queue";
@@ -103,6 +105,106 @@
​
describe("ProviderContinuationService", () => {
+ it.effect.each(["dispatch", "projection"] as const)(
+ "bounds delegated completion retries after persistent %s failure",
+ (failure) =>
+ Effect.gen(function* () {
+ const attempts = yield* Ref.make(0);
+ const attemptEvents = yield* Queue.unbounded<number>();
+ const fail = Ref.updateAndGet(attempts, (count) => count + 1).pipe(
+ Effect.tap((count) => Queue.offer(attemptEvents, count)),
+ Effect.andThen(Effect.die("persistent continuation failure")),
+ );
+ const threads = Layer.mock(ThreadManagementService.ThreadManagementService)({
+ getThreadRecords: () =>
+ failure === "projection" ? fail : Effect.succeed(delegatedProjection()),
+ dispatch: () => fail,