{"record":{"id":"5643b86c7f3a237b","repo":"koala73/worldmonitor","slug":"recordpoolfilterstats-no-run-args-runid","errorCode":null,"errorMessage":"[_recordPoolFilterStats] no run ${args.runId}","messagePattern":"\\[_recordPoolFilterStats\\] no run (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/waveRuns.ts","lineNumber":481,"sourceCode":" * them for THIS run's pool selection remains useful even if the lease has\n * since rotated. Throws only if the run row itself is missing (a logic\n * bug in the caller, not a normal recovery scenario).\n */\nexport const _recordPoolFilterStats = internalMutation({\n  args: {\n    runId: v.string(),\n    excludeNonEnglish: v.boolean(),\n    eligiblePoolCount: v.number(),\n    excludedCount: v.number(),\n    excludedLocaleCounts: v.record(v.string(), v.number()),\n  },\n  handler: async (ctx, args) => {\n    const run = await ctx.db\n      .query(\"waveRuns\")\n      .withIndex(\"by_runId\", (q) => q.eq(\"runId\", args.runId))\n      .unique();\n    if (!run) {\n      throw new Error(`[_recordPoolFilterStats] no run ${args.runId}`);\n    }\n    await ctx.db.patch(run._id, {\n      excludeNonEnglish: args.excludeNonEnglish,\n      eligiblePoolCount: args.eligiblePoolCount,\n      excludedCount: args.excludedCount,\n      excludedLocaleCounts: args.excludedLocaleCounts,\n      updatedAt: Date.now(),\n    });\n    return { ok: true as const };\n  },\n});\n\n// ───────────────────────────────────────────────────────────────────────────\n// Pick phase\n// ───────────────────────────────────────────────────────────────────────────\n\n/**\n * Acquire the wave-run lease atomically. Refuses if:","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/koala73/worldmonitor/blob/7d06c8633d256c18e38133030bc3613976a96ec9/convex/broadcast/waveRuns.ts#L463-L499","documentation":"Internal invariant guard in _recordPoolFilterStats: no waveRuns row exists for the supplied runId. Per the docstring this is a caller logic bug (the action lost or never persisted its run row), not a normal recovery scenario — pool-filter statistics have nowhere to be recorded.","triggerScenarios":"Thrown at convex/broadcast/waveRuns.ts:466 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trace the calling pickWaveAction run to see why its waveRuns row disappeared (deleted, or a mismatched runId)","Fix the caller to pass the runId returned by the lease claim that inserted the row"],"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"}