Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(relay): end idle Live Activities after the display window #11943

Mergedishaanko(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/11943/headmerged by juliusmarminge View on GitHub

Showing 9 changed files with 184 additions and 1 deletion (loading 6).

x
0 of 9 viewed, 9 left
63 additions and 0 deletionsinfra/relay/src/agentActivity/AgentActivityPublisher.test.tsModified
View file
@@ -2,6 +2,7 @@
import { describe, expect, it } from "@effect/vitest";
import * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
+import * as TestClock from "effect/testing/TestClock";
​
import * as AgentActivityRows from "./AgentActivityRows.ts";
import * as EnvironmentLinks from "../environments/EnvironmentLinks.ts";
@@ -58,6 +59,7 @@
return {
register: () => Effect.void,
listTargets: () => Effect.succeed([]),
+ listIdleArmedTargets: () => Effect.succeed([]),
markDelivery: () => Effect.void,
markStartQueued: () => Effect.void,
clearStartQueued: () => Effect.void,
@@ -268,6 +270,67 @@
});
});
​
+ it.effect("ends an idle card after finished work ages out without another publish", () => {
+ const sent: Array<Parameters<ApnsDeliveries.ApnsDeliveries["Service"]["sendForTarget"]>[0]> =
+ [];
+ let activeStates: ReadonlyArray<RelayAgentActivityState> = [state];
+ const endIdle = AgentActivityPublisher.AgentActivityPublisher.pipe(
+ Effect.flatMap((publisher) => publisher.endIdleLiveActivities),
+ Effect.provide(
+ layerPublisher.pipe(