Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): settle snoozed threads immediately #5379

Merged0bkevin(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/5379/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 102 additions and 13 deletions.

x
0 of 2 viewed, 2 left
78 additions and 1 deletionapps/server/src/orchestration/decider.settled.test.tsModified
View file
@@ -24,6 +24,11 @@
session: OrchestrationSession | null = null,
activities: OrchestrationThread["activities"] = [],
messages: OrchestrationThread["messages"] = [],
+ lifecycle: {
+ readonly pinnedAt?: string | null;
+ readonly snoozedUntil?: string | null;
+ readonly snoozedAt?: string | null;
+ } = {},
): OrchestrationReadModel {
return {
snapshotSequence: 0,
@@ -44,6 +49,9 @@
archivedAt,
settledOverride,
settledAt: settledOverride === "settled" ? SETTLED_AT : null,
+ snoozedUntil: lifecycle.snoozedUntil ?? null,
+ snoozedAt: lifecycle.snoozedAt ?? (lifecycle.snoozedUntil != null ? SETTLED_AT : null),
+ pinnedAt: lifecycle.pinnedAt ?? null,
deletedAt: null,
messages,
proposedPlans: [],
@@ -69,7 +77,7 @@
​
it.layer(NodeServices.layer)("settled thread decider", (it) => {
- it.effect("settles active threads and re-emits idempotently for settled ones", () =>
+ it.effect("settles awake threads without a redundant wake and re-emits idempotently", () =>