{"record":{"id":"a738ce2e5fbf99c2","repo":"koala73/worldmonitor","slug":"recordpendingbroadcast-no-ramp-configured","errorCode":null,"errorMessage":"[_recordPendingBroadcast] no ramp configured","messagePattern":"\\[_recordPendingBroadcast\\] no ramp configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/rampRunner.ts","lineNumber":752,"sourceCode":"});\n\n/**\n * Persist post-`createProLaunchBroadcast` progress. Called by the runner\n * AFTER `createProLaunchBroadcast` returns successfully. Lets\n * `recoverFromPartialFailure` recover the broadcastId without\n * operator-supplied metadata if the action dies between this point and a\n * successful `_recordWaveSent`.\n *\n * Lease-validating: same semantics as `_recordPendingExport`.\n */\nexport const _recordPendingBroadcast = internalMutation({\n  args: {\n    runId: v.string(),\n    broadcastId: v.string(),\n  },\n  handler: async (ctx, args) => {\n    const row = await loadConfig(ctx);\n    if (!row) throw new Error(\"[_recordPendingBroadcast] no ramp configured\");\n    if (row.pendingRunId !== args.runId) {\n      throw new Error(\n        `[_recordPendingBroadcast] lease lost: expected runId=${args.runId}, found ${row.pendingRunId ?? \"<cleared>\"}. Refusing to persist broadcast progress — operator/another run owns the state.`,\n      );\n    }\n    await ctx.db.patch(row._id, {\n      pendingBroadcastId: args.broadcastId,\n      pendingBroadcastAt: Date.now(),\n    });\n    return { ok: true as const };\n  },\n});\n\n/**\n * Internal mutation that the action calls to atomically advance the tier +\n * record a successful wave-send. Validates that the lease still belongs to\n * this runId AND clears all pending-progress markers.\n */","sourceCodeStart":734,"sourceCodeEnd":770,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/convex/broadcast/rampRunner.ts#L734-L770","documentation":"Internal guard in the _recordPendingBroadcast mutation: loadConfig returned no broadcastRampConfig row, so the broadcastId progress cannot be persisted. Runner-internal invariant failure — the config existed when the action started, so it was deleted mid-flight or the environment is wrong.","triggerScenarios":"Thrown at convex/broadcast/rampRunner.ts:750 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check whether broadcastRampConfig was reset while the wave run was mid-flight","Record the Resend broadcastId manually and use recoverFromPartialFailure('manual-finished') to close out the wave"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d06c8633d256c18e38133030bc3613976a96ec9","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}