{"record":{"id":"b2cf2e4bd2b70835","repo":"koala73/worldmonitor","slug":"clearpartialfailure-no-ramp-configured","errorCode":null,"errorMessage":"[clearPartialFailure] no ramp configured","messagePattern":"\\[clearPartialFailure\\] no ramp configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/rampRunner.ts","lineNumber":297,"sourceCode":" * audience tables AND verify no broadcast in the Resend dashboard before\n * calling.\n *\n * For ANY case where the export ran (segment created, contacts stamped,\n * broadcast created, or send fired), use `recoverFromPartialFailure` —\n * `manual-finished` if the wave actually went out, `discard-and-rotate` if\n * not.\n */\nexport const clearPartialFailure = internalMutation({\n  args: {\n    reason: v.string(),\n    // Literal-true forces the operator to actively assert \"I have verified no\n    // export happened.\" A future caller can't accidentally pass `false` to\n    // bypass this.\n    confirmNoExport: v.literal(true),\n  },\n  handler: async (ctx, { reason }) => {\n    const row = await loadConfig(ctx);\n    if (!row) throw new Error(\"[clearPartialFailure] no ramp configured\");\n    if (row.lastRunStatus !== \"partial-failure\") {\n      return {\n        ok: true as const,\n        noop: true as const,\n        currentStatus: row.lastRunStatus,\n      };\n    }\n    // Fail-closed: if any pending-progress marker exists, the export DID make\n    // progress past `assignAndExportWave` — clearing here would mask a stamped\n    // / sent wave. Force the operator to use recoverFromPartialFailure.\n    if (\n      row.pendingWaveLabel ||\n      row.pendingSegmentId ||\n      row.pendingBroadcastId\n    ) {\n      throw new Error(\n        `[clearPartialFailure] refused: pending progress markers present (waveLabel=${row.pendingWaveLabel ?? \"-\"}, segmentId=${row.pendingSegmentId ?? \"-\"}, broadcastId=${row.pendingBroadcastId ?? \"-\"}). The export DID run; clearing here would mask stamped contacts. Use recoverFromPartialFailure instead.`,\n      );","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/convex/broadcast/rampRunner.ts#L279-L315","documentation":"Operator guard in the clearPartialFailure internal mutation: loadConfig returned no broadcastRampConfig row, so there is no partial-failure state to clear — the ramp was never configured on this deployment.","triggerScenarios":"Thrown at convex/broadcast/rampRunner.ts:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run configureRamp before attempting failure-state recovery","Verify the Convex deployment/environment actually hosts the broadcast ramp"],"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"}