{"record":{"id":"4b7f673ba2494613","repo":"koala73/worldmonitor","slug":"clearpartialfailure-refused-pending-progress-ma","errorCode":null,"errorMessage":"[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.","messagePattern":"\\[clearPartialFailure\\] refused: pending progress markers present \\(waveLabel=(.+?), segmentId=(.+?), broadcastId=(.+?)\\)\\. The export DID run; clearing here would mask stamped contacts\\. Use recoverFromPartialFailure instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/rampRunner.ts","lineNumber":313,"sourceCode":"  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      );\n    }\n    await ctx.db.patch(row._id, {\n      lastRunStatus: `partial-failure-cleared: ${reason.slice(0, 200)}`,\n      lastRunError: undefined,\n      pendingRunId: undefined,\n      pendingRunStartedAt: undefined,\n    });\n    return { ok: true as const };\n  },\n});\n\n/**\n * Structured recovery for `lastRunStatus === \"partial-failure\"` that ALSO\n * occurred AFTER `assignAndExportWave` succeeded (or after a forced lease\n * release on a wedged run). Two recovery modes:\n *","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/convex/broadcast/rampRunner.ts#L295-L331","documentation":"Error \"[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.\" thrown in koala73/worldmonitor.","triggerScenarios":"Thrown at convex/broadcast/rampRunner.ts:313 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Follow the error's own guidance: use recoverFromPartialFailure ('manual-finished' if the wave went out, 'discard-and-rotate' if not) instead of clearPartialFailure","Verify in the Resend dashboard and audience tables whether the pending wave/segment/broadcast actually went out before choosing a recovery mode","Only use clearPartialFailure when confirmNoExport is genuinely true and no pending markers exist"],"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"}