@gentbajko/slopify 4.5.3 → 4.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -70,6 +70,7 @@ import { createNotificationSender } from "./slices/notifications/send.js";
70
70
  import { createServerNotifier } from "./slices/notifications/server.js";
71
71
  import { seedSamples } from "./slices/onboarding/sample.js";
72
72
  import { templateById } from "./slices/project-templates/repo.js";
73
+ import { continueHeldRun } from "./slices/rebuild/continue-held.js";
73
74
  import { createNarrationRetries } from "./slices/rebuild/narration-retry.js";
74
75
  import { recoverProject } from "./slices/rebuild/recovery.js";
75
76
  import { claimWork, finishWork, maySubmit } from "./slices/rebuild/repo.js";
@@ -518,6 +519,8 @@ export async function boot(config, options = {}) {
518
519
  const scheduleRunnerDeps = {
519
520
  ...draftDeps,
520
521
  designs: () => designMake,
522
+ // A made-ahead run a restart stopped goes on when its day takes it.
523
+ continueRun: (projectId) => continueHeldRun(rebuild, projectId),
521
524
  // The newest version that may run: legacy, marked ready, or carried by Slopify. Only a
522
525
  // project template's: a design schedule asks the designs (runnableDesignVersion).
523
526
  template: (id) => runnableTemplate(runtimeDb, id),
@@ -0,0 +1,10 @@
1
+ # Slopify 4.5.4
2
+
3
+ Released 21 November 2026.
4
+
5
+ A video made ahead waits for its day again after a restart, instead of reading Stopped.
6
+
7
+ ## A video made ahead no longer reads Stopped after a restart and Continue
8
+
9
+ - **A video made ahead waits for its day again after Continue the run.** When the app restarted while a schedule was making a video ahead, the video could read Stopped, with Continue the run offered, even after pressing Continue the run or Try again: a step that only stood in for the narration until the article was written stayed on the video after its narration was voiced, the restart held it, and Continue had nothing to start it with. Such a video would not have been rendered on its day. That leftover step is now dropped as soon as the narration it stood for is planned, and a video already stuck this way reads Waiting for its day again after one more Continue the run. Nothing is voiced, drawn or paid for again, and every checkpoint still waits for its approval.
10
+ - Technical: `materializeAdmittedWork` (`rebuild/runtime-materialize.ts`) removes the head's reservation of an admitted, never-started `:future` placeholder of an unfinished stage once its version's plan no longer defers that key and every step it anchors (`futureKey`) is reserved on the head, held or allowed alike. Before, such a placeholder was carried into each new version (`preserveDeferredIntent`), held by `recoverWork` at boot, and never admitted again by Continue, so `heldBesideReviews` (`reviews/holds.ts`) kept the run stopped.
@@ -0,0 +1,13 @@
1
+ # Slopify 4.5.5
2
+
3
+ Released 27 November 2026.
4
+
5
+ A video made ahead is now made on its day even after the computer restarted, and a schedule that skips its runs says which video holds it back.
6
+
7
+ ## A video made ahead is rendered on its day after a restart
8
+
9
+ - **Its day now continues a video made ahead that a restart stopped.** When the app restarted while a schedule held a video made ahead for its day, the video read Stopped, and on its day the schedule took it but nothing rendered it until someone pressed Continue the run. The schedule's day is the go-ahead, so it now does what Continue the run would: the steps the restart held go on and the video is made. Nothing already made is made or paid for again, a project you paused stays paused, and a checkpoint of yours still waits for your approval.
10
+ - **The day never starts paid work you didn't start.** If settings saved on the video since need new paid steps that were never started, the day leaves it Stopped and the schedule's run history says so, with the button to press.
11
+ - **A skipped run says which video holds it back.** A schedule skips its runs while the video of an earlier run is unfinished. When that video is paused, stopped by a restart, waiting for your review or has a failed step, the skipped run now names the video and says what to press, instead of only "the previous run was still going". In what needs attention, that video's entry also says which schedule waits on it.
12
+ - A video made ahead still reads Stopped between a restart and its day when the restart held its steps; its day now moves it on by itself.
13
+ - Technical: `continuePrepared` (`schedules/prepare.ts`) is async and, for a project with a `prepared_videos` row, calls the new `ScheduleDeps.continueRun`, wired in `main.ts` to `continueHeldRun` (`rebuild/continue-held.ts`). That calls `recoverProject` with `{ kind: "resume" }` only when the head has restart-held admitted work (`dispatch_state='held'`, `pendingAdmitted`, no waiting external review), the project isn't paused, and every provider recipe the resume plan would make is already reserved on the head with the same fingerprint; otherwise it returns a refusal sentence the scheduler stores as the run's `error`. `overlapSentence` (`schedules/held-back.ts`) replaces the fixed overlap skip text, and `needsAttention` appends the schedules an unsettled run's project holds back.
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "id": "4.5.5",
4
+ "title": "Slopify 4.5.5",
5
+ "version": "4.5.5",
6
+ "date": "2026-11-27"
7
+ },
8
+ {
9
+ "id": "4.5.4",
10
+ "title": "Slopify 4.5.4",
11
+ "version": "4.5.4",
12
+ "date": "2026-11-21"
13
+ },
2
14
  {
3
15
  "id": "4.5.3",
4
16
  "title": "Slopify 4.5.3",
@@ -4,6 +4,7 @@ import { liveProject } from "../admission/repo.js";
4
4
  import { externalReviewOf } from "../reviews/external-rows.js";
5
5
  import { waitingExternalReviewRows } from "../reviews/external-waiting.js";
6
6
  import { projectHolds } from "../reviews/holds.js";
7
+ import { heldBack } from "../schedules/held-back.js";
7
8
  import { templateSampleProjects } from "../template-studio/repo.js";
8
9
  import { setAsideProjects } from "../uploads/repo.js";
9
10
  import { postsWaiting } from "./attention-posts.js";
@@ -58,6 +59,7 @@ export function needsAttention(deps, now) {
58
59
  ];
59
60
  const aside = setAsideProjects(db);
60
61
  const samples = templateSampleProjects(db);
62
+ const blocking = schedulesHeldBack(deps);
61
63
  return sources
62
64
  .flatMap(([source, entries]) => {
63
65
  try {
@@ -71,8 +73,35 @@ export function needsAttention(deps, now) {
71
73
  }
72
74
  })
73
75
  .filter((entry) => entry.projectId === null || (!aside.has(entry.projectId) && !samples.has(entry.projectId)))
76
+ .map((entry) => {
77
+ const names = entry.projectId === null ? undefined : blocking.get(entry.projectId);
78
+ return names === undefined
79
+ ? entry
80
+ : {
81
+ ...entry,
82
+ reason: `${entry.reason} Until this video finishes, ${names.map((name) => `the schedule “${name}”`).join(" and ")} skips its runs.`,
83
+ };
84
+ })
74
85
  .toSorted((a, b) => a.since.localeCompare(b.since));
75
86
  }
87
+ // The schedules each unfinished video of an earlier run holds back (`schedules/held-back.ts`):
88
+ // said on that video's entries, since a schedule skips its runs until the video finishes.
89
+ function schedulesHeldBack(deps) {
90
+ const names = new Map();
91
+ try {
92
+ for (const one of heldBack(deps.db)) {
93
+ const listed = names.get(one.projectId) ?? [];
94
+ if (!listed.includes(one.scheduleName))
95
+ names.set(one.projectId, [...listed, one.scheduleName]);
96
+ }
97
+ }
98
+ catch (error) {
99
+ deps.log.write("error", "attention.source", {
100
+ detail: `needs_attention left out which schedules wait on a video because reading them failed: ${causedBy(error)}`,
101
+ });
102
+ }
103
+ return names;
104
+ }
76
105
  function titles(db) {
77
106
  return new Map(db
78
107
  .prepare("SELECT id, title FROM projects")
@@ -0,0 +1,69 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { pendingAdmitted } from "../admission/admitted-work.js";
3
+ import { projectPaused, stagesOf } from "../admission/repo.js";
4
+ import { currentRevisionId } from "../revisions/repo.js";
5
+ import { getRevisionView } from "../revisions/view.js";
6
+ import { planPreview } from "./preview-plan.js";
7
+ import { retainedPreviewPlan } from "./preview-retained.js";
8
+ import { recoverProject } from "./recovery.js";
9
+ import { resumeSelection } from "./recovery-selection.js";
10
+ const fix = "Open it in Projects and press Continue the run.";
11
+ // The scheduled day is the go-ahead for a video made ahead, so a run a restart stopped goes on
12
+ // as Continue the run would take it on: the steps a restart held on its current version are let
13
+ // go again. Only steps already admitted go on. A step that costs money and was never admitted
14
+ // (an edit saved on it and never started) waits for the person, so the day spends nothing they
15
+ // didn't start. A Pause is left alone, and a person's checkpoint still holds what it holds.
16
+ export async function continueHeldRun(deps, projectId) {
17
+ const head = currentRevisionId(deps.db, projectId);
18
+ if (head === undefined || projectPaused(deps.db, projectId))
19
+ return { kind: "untouched" };
20
+ const held = deps.db
21
+ .prepare(`SELECT 1 FROM revision_work w WHERE w.project_id=? AND w.dispatch_state='held' AND ${pendingAdmitted("w")}
22
+ AND NOT EXISTS (SELECT 1 FROM external_reviews e WHERE e.work_id=w.id AND e.state='waiting')
23
+ LIMIT 1`)
24
+ .get(projectId);
25
+ if (held === undefined)
26
+ return { kind: "untouched" };
27
+ const view = getRevisionView(deps, projectId, head);
28
+ if (view === undefined)
29
+ return { kind: "untouched" };
30
+ const catalogue = deps.catalogue.read();
31
+ const selection = resumeSelection(retainedPreviewPlan(deps, view, catalogue), stagesOf(deps.db, projectId));
32
+ const planned = planPreview(deps, view, catalogue, selection, deps.ids.next());
33
+ if (!planned.ok)
34
+ return {
35
+ kind: "refused",
36
+ sentence: `This run took the video made ahead but couldn't continue it, because what is left to make couldn't be worked out. ${fix}`,
37
+ };
38
+ const { execution } = planned.value;
39
+ const reused = new Set(execution.dispositions.filter((row) => row.disposition === "reuse").map((row) => row.key));
40
+ // Admitted already: reserved on this version under the same starting point and not finished,
41
+ // which is the step admission lets go again rather than makes anew (`admission-repo.ts`).
42
+ const admitted = (key, fingerprint) => deps.db
43
+ .prepare(`SELECT 1 FROM revision_work_reservations r JOIN revision_work w ON w.id=r.work_id
44
+ WHERE r.revision_id=? AND r.work_key=? AND r.fingerprint=? AND w.state!='done'
45
+ AND w.recipe_context IS NOT NULL`)
46
+ .get(head, key, fingerprint) !== undefined;
47
+ const unstarted = execution.recipes.filter((recipe) => recipe.kind === "provider" &&
48
+ !reused.has(recipe.key) &&
49
+ !admitted(recipe.key, recipe.fingerprint));
50
+ if (unstarted.length > 0)
51
+ return {
52
+ kind: "refused",
53
+ sentence: `This run took the video made ahead but didn't continue it, because settings saved on it since need new paid steps that were never started (${String(unstarted.length)}). ${fix}`,
54
+ };
55
+ const result = await recoverProject(deps, projectId, {
56
+ baseRevisionId: head,
57
+ idempotencyKey: randomUUID(),
58
+ action: { kind: "resume" },
59
+ });
60
+ if (result.ok)
61
+ return { kind: "continued" };
62
+ const detail = result.reason === "readiness" && result.fields !== undefined && result.fields.length > 0
63
+ ? result.fields.map((field) => field.message).join(" ")
64
+ : `Slopify refused to continue it (${result.reason}).`;
65
+ return {
66
+ kind: "refused",
67
+ sentence: `This run took the video made ahead but couldn't continue it. ${detail} ${fix}`,
68
+ };
69
+ }
@@ -27,7 +27,13 @@ export function materializeAdmittedWork(deps, projectId) {
27
27
  .prepare(`SELECT r.*,w.revision_id AS origin_revision,w.recipe_context,w.admission_id FROM revision_work_reservations r JOIN revision_work w ON w.id=r.work_id WHERE r.project_id=? AND r.revision_id=? AND w.dispatch_state='allowed' AND w.recipe_context IS NOT NULL`)
28
28
  .all(projectId, head)
29
29
  .map((row) => reservation.parse(row));
30
+ // The versions whose plans say what the head's admitted work unfolds into: those of its
31
+ // allowed steps, and those of the placeholders a restart held (`retireUnfolded`).
30
32
  const origins = new Map(reservations.map((row) => [row.origin_revision, row]));
33
+ const placeholders = waitingPlaceholders(deps, projectId, head);
34
+ for (const row of placeholders)
35
+ if (!origins.has(row.origin_revision))
36
+ origins.set(row.origin_revision, row);
31
37
  // The head's view, read once: each narration part used to read the whole version again.
32
38
  let headView = null;
33
39
  const headOnce = () => {
@@ -112,9 +118,64 @@ export function materializeAdmittedWork(deps, projectId) {
112
118
  fingerprint: anchor.desired_fingerprint ?? anchor.fingerprint,
113
119
  }, plan.work.find((row) => row.key === recipe.key)?.disposition === "reuse", head, anchor.admission_id);
114
120
  }
121
+ retireUnfolded(deps, head, origin.origin_revision, plan, placeholders);
115
122
  }
116
123
  });
117
124
  }
125
+ const placeholderRow = z.object({
126
+ work_id: z.string(),
127
+ work_key: z.string(),
128
+ origin_revision: z.string(),
129
+ recipe_context: z.string(),
130
+ });
131
+ // The head's `:future` placeholders a run admitted that still keep their stage unfinished
132
+ // (`admittedUnfinished`), waiting and never begun: no attempt, nothing sent. Allowed or held
133
+ // alike: a restart holds every unfinished step. One of a finished stage holds nothing up, and
134
+ // its version isn't planned again for it on every pass.
135
+ function waitingPlaceholders(deps, projectId, head) {
136
+ return deps.db
137
+ .prepare(`SELECT r.work_id,r.work_key,w.revision_id AS origin_revision,w.recipe_context
138
+ FROM revision_work_reservations r JOIN revision_work w ON w.id=r.work_id
139
+ JOIN revision_work_pieces p ON p.id=r.piece_id AND p.work_id=w.id
140
+ WHERE r.project_id=? AND r.revision_id=? AND r.work_key LIKE '%:future'
141
+ AND w.state='pending' AND w.recipe_context IS NOT NULL
142
+ AND EXISTS (SELECT 1 FROM stages s WHERE s.project_id=w.project_id AND s.id=w.stage_id
143
+ AND s.state NOT IN ('done','provided','skipped'))
144
+ AND json_extract(p.input_json,'$.kind')='deferred'
145
+ AND NOT EXISTS (SELECT 1 FROM attempts a WHERE a.work_id=w.id)
146
+ AND NOT EXISTS (SELECT 1 FROM revision_work_pieces q WHERE q.work_id=w.id
147
+ AND (q.submitted_at IS NOT NULL OR q.continuation IS NOT NULL))`)
148
+ .all(projectId, head)
149
+ .map((row) => placeholderRow.parse(row));
150
+ }
151
+ // A `:future` step stands in for work not known yet (a narration's chunks before its text is
152
+ // written) and never runs itself (`runtime-run.ts`). Once its version's plan has unfolded it,
153
+ // no step of that key deferred any more and every step it stood for reserved on the head, it
154
+ // is a leftover the head lets go of. Kept, a restart held it (`recoverWork`), and Continue the
155
+ // run, which admits only what the plan still lists, never released it: the run read Stopped
156
+ // with nothing left to make. Nothing runs or is paid for: only the head's reservation of a
157
+ // step that never started goes, and the step stays in its own version's history.
158
+ function retireUnfolded(deps, head, origin, plan, placeholders) {
159
+ const reserved = (key) => deps.db
160
+ .prepare("SELECT 1 FROM revision_work_reservations WHERE revision_id=? AND work_key=?")
161
+ .get(head, key) !== undefined;
162
+ for (const row of placeholders) {
163
+ if (row.origin_revision !== origin)
164
+ continue;
165
+ if (plan.recipes.some((recipe) => recipe.key === row.work_key && recipe.deferred))
166
+ continue;
167
+ const waiting = plan.recipes.some((recipe) => recipe.key !== row.work_key &&
168
+ !recipe.deferred &&
169
+ futureKey(recipe) === row.work_key &&
170
+ plan.work.some((work) => work.key === recipe.key) &&
171
+ !reserved(recipe.key));
172
+ if (waiting)
173
+ continue;
174
+ deps.db
175
+ .prepare("DELETE FROM revision_work_reservations WHERE revision_id=? AND work_key=? AND work_id=?")
176
+ .run(head, row.work_key, row.work_id);
177
+ }
178
+ }
118
179
  // Only a row nothing has touched: still pending, one unsent piece, no attempt. Anything
119
180
  // further along keeps the old path, which retires it and admits a fresh row.
120
181
  function refreshWaiting(deps, head, own, recipe) {
@@ -0,0 +1,62 @@
1
+ import { z } from "zod";
2
+ import { projectPaused, stagesOf } from "../admission/repo.js";
3
+ import { projectHolds } from "../reviews/holds.js";
4
+ import { heldForItsDay } from "./prepare.js";
5
+ import { projectIsActive } from "./repo.js";
6
+ const row = z.object({
7
+ schedule_id: z.string(),
8
+ name: z.string(),
9
+ project_id: z.string(),
10
+ title: z.string(),
11
+ });
12
+ // Oldest run first. A schedule deleted holds nothing back.
13
+ export function heldBack(db, scheduleId) {
14
+ const rows = db
15
+ .prepare(`SELECT r.schedule_id, s.name, admitted.value AS project_id, p.title
16
+ FROM schedule_runs r, json_each(r.project_ids_json) AS admitted
17
+ JOIN schedules s ON s.id=r.schedule_id AND s.deleted_at IS NULL
18
+ JOIN projects p ON p.id=admitted.value
19
+ WHERE r.projects_settled_at IS NULL AND r.status!='running'
20
+ AND (?1 IS NULL OR r.schedule_id=?1)
21
+ ORDER BY r.scheduled_for, r.started_at, r.id`)
22
+ .all(scheduleId ?? null)
23
+ .map((value) => row.parse(value));
24
+ return rows
25
+ .filter((one) => projectIsActive(db, one.project_id))
26
+ .map((one) => ({
27
+ scheduleId: one.schedule_id,
28
+ scheduleName: one.name,
29
+ projectId: one.project_id,
30
+ title: one.title,
31
+ }));
32
+ }
33
+ const generic = "Skipped because the previous run of this schedule was still going.";
34
+ // Why a run was skipped for overlap, naming the earlier run's video when nothing but the
35
+ // person moves it on: what stops it, and the button that fixes it.
36
+ export function overlapSentence(db, scheduleId) {
37
+ const first = heldBack(db, scheduleId)[0];
38
+ if (first === undefined)
39
+ return generic;
40
+ const video = `the video of an earlier run, “${first.title}”,`;
41
+ const after = "; this schedule's runs go ahead again once it finishes.";
42
+ if (projectPaused(db, first.projectId))
43
+ return `Skipped because ${video} is paused. Open it in Projects and press Continue the run${after}`;
44
+ const failed = stagesOf(db, first.projectId).find((stage) => stage.state === "failed");
45
+ if (failed !== undefined)
46
+ return `Skipped because ${video} has a failed ${failed.kind} step. Open it in Projects and press Try again on that step${after}`;
47
+ const holds = projectHolds(db, { projectId: first.projectId });
48
+ if (holds.stopped.has(first.projectId))
49
+ return `Skipped because ${video} stopped before it finished, as a restart leaves a run. Open it in Projects and press Continue the run${after}`;
50
+ // Any checkpoint of the person's left to approve, reached or not: the video can't be made
51
+ // until it is (one whose inputs are still being made holds nothing yet, `holds.ts`).
52
+ const review = db
53
+ .prepare(`SELECT c.stage FROM review_checkpoints c
54
+ JOIN project_heads h ON h.project_id=c.project_id AND h.revision_id=c.revision_id
55
+ WHERE c.project_id=? AND c.state IN ('held','pending-review') AND c.approved_at IS NULL
56
+ AND NOT (c.stage='video' AND ${heldForItsDay("c")})
57
+ ORDER BY c.created_at LIMIT 1`)
58
+ .get(first.projectId);
59
+ if (typeof review?.stage === "string")
60
+ return `Skipped because ${video} waits for your review before its ${review.stage} step. Open it in Projects and approve it${after}`;
61
+ return generic;
62
+ }
@@ -1,3 +1,4 @@
1
+ import { errorText } from "../../kernel/errors.js";
1
2
  import { derive } from "../../kernel/runner/graph.js";
2
3
  import { projectPaused, stagesOf } from "../admission/repo.js";
3
4
  import { render } from "../admission/substitute.js";
@@ -141,8 +142,13 @@ export function preparedProject(db, scheduleId, title, byTitle = true) {
141
142
  }
142
143
  // The scheduled day for a prepared video: its own Before Video hold is taken away, so the
143
144
  // video renders as soon as what it needs is done. A Before Video checkpoint the template had
144
- // stays for the person to approve.
145
- export function continuePrepared(deps, prepared) {
145
+ // stays for the person to approve. The day is the go-ahead for a video made ahead: one a restart
146
+ // stopped goes on as Continue the run would take it on (`continueHeldRun`), never past a Pause
147
+ // or a person's checkpoint. What it couldn't continue is said in a sentence for the run.
148
+ export async function continuePrepared(deps, prepared) {
149
+ const madeAhead = deps.db
150
+ .prepare("SELECT 1 FROM prepared_videos WHERE project_id=? LIMIT 1")
151
+ .get(prepared.projectId) !== undefined;
146
152
  if (prepared.release) {
147
153
  const head = currentRevisionId(deps.db, prepared.projectId);
148
154
  if (head !== undefined) {
@@ -154,7 +160,29 @@ export function continuePrepared(deps, prepared) {
154
160
  }
155
161
  // Continued once: the topic is used, and the project is now the run's.
156
162
  deps.db.prepare("DELETE FROM prepared_videos WHERE project_id=?").run(prepared.projectId);
163
+ let sentence;
164
+ if (madeAhead && deps.continueRun !== undefined) {
165
+ try {
166
+ const outcome = await deps.continueRun(prepared.projectId);
167
+ if (outcome.kind === "refused")
168
+ sentence = outcome.sentence;
169
+ }
170
+ catch (error) {
171
+ deps.log.write("error", "schedule.continue", {
172
+ projectId: prepared.projectId,
173
+ detail: errorText(error),
174
+ });
175
+ sentence =
176
+ "This run took the video made ahead but couldn't continue it, because Slopify hit an internal error. Open it in Projects and press Continue the run.";
177
+ }
178
+ if (sentence !== undefined)
179
+ deps.log.write("warn", "schedule.continue", {
180
+ projectId: prepared.projectId,
181
+ detail: sentence,
182
+ });
183
+ }
157
184
  deps.runner.tick(prepared.projectId);
185
+ return sentence;
158
186
  }
159
187
  // Which of a schedule's topics are prepared, and their projects, for the topic list.
160
188
  export function preparedTopics(deps, scheduleId) {
@@ -251,7 +251,7 @@ export function settleTerminalScheduleRuns(db, settledAt) {
251
251
  return settled;
252
252
  });
253
253
  }
254
- function projectIsActive(db, projectId) {
254
+ export function projectIsActive(db, projectId) {
255
255
  // A project in the trash takes no part in a schedule's overlap: it cannot run there.
256
256
  if (!projectExists(db, projectId))
257
257
  return false;
@@ -4,6 +4,7 @@ import { createDraft } from "../play-drafts/service.js";
4
4
  import { startPlayDraft } from "../play-drafts/start.js";
5
5
  import { nextOccurrence } from "./calendar.js";
6
6
  import { claimDesignRun } from "./design-run.js";
7
+ import { overlapSentence } from "./held-back.js";
7
8
  import { missedGraceMs } from "./next-run.js";
8
9
  import { continuePrepared, preparedProject, scheduledDocument, scheduledTitle } from "./prepare.js";
9
10
  import { activeRun, dueSchedules, insertRun, recordRunDispatch, recordRunStartIdentity, recoverRunningRuns, scheduleById, scheduleRows, updateRun, } from "./repo.js";
@@ -117,7 +118,7 @@ function claim(deps, schedule, now) {
117
118
  endedAt: skip ? now.toISOString() : null,
118
119
  error: skip
119
120
  ? overlapping
120
- ? "Skipped because the previous run of this schedule was still going."
121
+ ? overlapSentence(deps.db, schedule.id)
121
122
  : occurrence
122
123
  ? "Skipped because Slopify was not running at the scheduled time."
123
124
  : (noTopic ?? notReady)
@@ -151,10 +152,15 @@ async function execute(deps, claimed) {
151
152
  // than make the same video twice.
152
153
  const prepared = preparedProject(deps.db, claimed.schedule.id, scheduledTitle(fresh), topic !== undefined);
153
154
  if (prepared !== undefined) {
154
- continuePrepared(deps, prepared);
155
155
  run = { ...run, projectIds: [prepared.projectId] };
156
156
  recordRunDispatch(deps.db, run, deps.clock.now().toISOString(), topic);
157
- updateRun(deps.db, { ...run, status: "succeeded", endedAt: deps.clock.now().toISOString() });
157
+ const stuck = await continuePrepared(deps, prepared);
158
+ updateRun(deps.db, {
159
+ ...run,
160
+ status: "succeeded",
161
+ endedAt: deps.clock.now().toISOString(),
162
+ ...(stuck === undefined ? {} : { error: stuck }),
163
+ });
158
164
  return;
159
165
  }
160
166
  const draft = createDraft(deps, { id: deps.uuid(), document: fresh });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gentbajko/slopify",
3
- "version": "4.5.3",
3
+ "version": "4.5.5",
4
4
  "description": "Turn a prompt into a finished video, locally, with your own provider keys",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Gent Bajko",