Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): mobile push no longer says "completed" between runs #24769

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

Showing 2 changed files with 150 additions and 2 deletions.

x
0 of 2 viewed, 2 left
111 additions and 0 deletionsapps/server/src/relay/AgentAwarenessRelay.test.tsModified
View file
@@ -392,6 +392,8 @@
const terminal = shell({ status });
yield* Ref.set(currentShell, terminal);
yield* relay.publishThread(THREAD_ID);
+ yield* TestClock.adjust("5 seconds");
+ yield* relay.drain;
assert.equal(publications[1]?.state?.phase, status);
​
const now = yield* DateTime.now;
@@ -419,6 +421,113 @@
}).pipe(Effect.scoped),
​
+ it.effect("holds a completion through a continuation gap, then publishes it once", () =>
+ Effect.gen(function* () {
+ const { relay, currentShell, publications } = yield* makeTestRelay();
+ yield* relay.publishThread(THREAD_ID);
+ yield* Ref.set(currentShell, shell({ status: "completed" }));
+ yield* relay.publishThread(THREAD_ID);
+ yield* Ref.set(currentShell, shell());
+ yield* relay.publishThread(THREAD_ID);
+ yield* TestClock.adjust("5 seconds");
+ yield* relay.drain;
+ assert.deepEqual(
+ publications.map((publication) => publication.state?.phase),
+ ["running"],
+ );
+​
+ yield* Ref.set(currentShell, shell({ status: "completed" }));