GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): scheduled-task runs no longer un-snooze the thread they … · patroza/t3code@4fd2486

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/server/src/orchestration-v2
    • Orchestrator.ts
    • runtimeLayer.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/Orchestrator.ts
+5-3Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7535,10 +7535,12 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
75357535
});
75367536
projection = applyToProjection(projection, event);
75377537
}
7538-
// Background wakes and delegated completions continue work the user already snoozed, so
7539-
// only a message someone actually sent ends the snooze.
7538+
// Background wakes, delegated completions and scheduled-task runs continue work the user
7539+
// already snoozed, so only a message someone actually sent ends the snooze.
75407540
const automaticWake =
7541-
command.notification !== undefined || command.delegatedCompletion !== undefined;
7541+
command.notification !== undefined ||
7542+
command.delegatedCompletion !== undefined ||
7543+
command.scheduledTaskId !== undefined;
75427544
if (projection.thread.snoozedUntil != null && !automaticWake) {
75437545
const now = yield* DateTime.now;
75447546
const thread: OrchestrationV2AppThread = {
Collapse file

‎apps/server/src/orchestration-v2/runtimeLayer.test.ts‎

Copy file name to clipboardExpand all lines: apps/server/src/orchestration-v2/runtimeLayer.test.ts
+7-3Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12895,7 +12895,7 @@ it.layer(layerTest)("snooze queued runs", (it) => {
1289512895
}),
1289612896
);
1289712897

12898-
it.effect.each(["notification", "user"] as const)(
12898+
it.effect.each(["notification", "scheduled-task", "user"] as const)(
1289912899
"a %s message on a snoozed thread keeps the snooze only when automatic",
1290012900
(kind) =>
1290112901
Effect.gen(function* () {
@@ -12931,8 +12931,8 @@ it.layer(layerTest)("snooze queued runs", (it) => {
1293112931
attachments: [],
1293212932
modelSelection,
1293312933
dispatchMode: { type: "queue_after_active" },
12934-
createdBy: kind === "user" ? "user" : "agent",
12935-
creationSource: kind === "user" ? "web" : "provider",
12934+
createdBy: kind === "notification" ? "agent" : "user",
12935+
creationSource: kind === "notification" ? "provider" : "web",
1293612936
...(kind === "notification"
1293712937
? {
1293812938
notification: {
@@ -12942,11 +12942,15 @@ it.layer(layerTest)("snooze queued runs", (it) => {
1294212942
},
1294312943
}
1294412944
: {}),
12945+
...(kind === "scheduled-task"
12946+
? { scheduledTaskId: ScheduledTaskId.make(`scheduled-task:${threadId}`) }
12947+
: {}),
1294512948
});
1294612949
const thread = (yield* orchestrator.getThreadProjection(threadId)).thread;
1294712950
if (kind === "user") {
1294812951
assert.isNull(thread.snoozedUntil);
1294912952
} else {
12953+
assert.isNotNull(thread.snoozedUntil);
1295012954
assert.equal(DateTime.formatIso(thread.snoozedUntil!), snoozedUntil);
1295112955
}
1295212956
}),

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.