koala73/worldmonitor · error · Error
[_markFinalizeFailed] no run ${runId}
Error message
[_markFinalizeFailed] no run ${runId} What it means
Internal invariant guard in _markFinalizeFailed: no waveRuns row exists for the supplied runId. The failure status (create-broadcast-failed / send-broadcast-failed) cannot be recorded because the run record is missing, so the failure must be tracked manually.
Source
Thrown at convex/broadcast/waveRuns.ts:1340
* finalize's clean state with `failureSubstatus='send-broadcast-failed'`,
* and a subsequent operator `markFinalizeRecovered` would re-advance the
* tier a second time.
*/
export const _markFinalizeFailed = internalMutation({
args: {
runId: v.string(),
substatus: v.union(
v.literal("create-broadcast-failed"),
v.literal("send-broadcast-failed"),
),
error: v.string(),
},
handler: async (ctx, { runId, substatus, error }) => {
const run = await ctx.db
.query("waveRuns")
.withIndex("by_runId", (q) => q.eq("runId", runId))
.unique();
if (!run) throw new Error(`[_markFinalizeFailed] no run ${runId}`);
// Terminal-status CAS. If a concurrent finalize already committed
// status='sent', this is a duplicate-finalize loser whose Resend
// 422-already-sent error landed it here. Treat as no-op success — the
// winner's state is correct; we should not overwrite it.
if (run.status === "sent") {
return { ok: false as const, reason: "already-sent" as const };
}
// Defensive: if already in a failed-with-different-substatus state,
// refuse to overwrite. Operator's existing recovery routing depends
// on the original substatus.
if (
run.status === "failed" &&
run.failureSubstatus !== undefined &&
run.failureSubstatus !== substatus
) {
return {
ok: false as const,View on GitHub (pinned to eeab0a219f)
Solutions
- Check the Resend dashboard for orphaned broadcasts or segments from the failed run and clean up manually
- Fix the caller so finalize failure recording uses the same runId that claimed the run
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at convex/broadcast/waveRuns.ts:1340 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of koala73/worldmonitor@eeab0a219f (2026-08-21).
Data as JSON: /api/errors/c56166ea4ae7bdb5.
Report an issue: GitHub.