{"record":{"id":"ba99b381053cb882","repo":"koala73/worldmonitor","slug":"createprolaunchbroadcast-resend-response-missing","errorCode":null,"errorMessage":"[createProLaunchBroadcast] Resend response missing id: ${JSON.stringify(json)}","messagePattern":"\\[createProLaunchBroadcast\\] Resend response missing id: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"convex/broadcast/sendBroadcast.ts","lineNumber":121,"sourceCode":"        reply_to: PRO_LAUNCH_REPLY_TO,\n        subject: PRO_LAUNCH_SUBJECT,\n        html: PRO_LAUNCH_HTML,\n        text: PRO_LAUNCH_TEXT,\n      }),\n    });\n\n    if (!res.ok) {\n      const body = await res.text().catch(() => \"<no body>\");\n      throw new Error(\n        `[createProLaunchBroadcast] Resend ${res.status}: ${body}`,\n      );\n    }\n\n    const json = (await res.json().catch(() => null)) as {\n      id?: string;\n    } | null;\n    if (!json?.id) {\n      throw new Error(\n        `[createProLaunchBroadcast] Resend response missing id: ${JSON.stringify(json)}`,\n      );\n    }\n\n    return {\n      broadcastId: json.id,\n      name,\n      segmentId,\n      subject: PRO_LAUNCH_SUBJECT,\n    };\n  },\n});\n\n/**\n * Send (or schedule) a previously-created Resend Broadcast.\n *\n * `scheduledAt`: ISO 8601 timestamp string OR a natural-language phrase\n * Resend accepts (\"in 2 hours\"). Omit for immediate send.","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/koala73/worldmonitor/blob/eeab0a219fce0f02a00603b532dbae9041b934ac/convex/broadcast/sendBroadcast.ts#L103-L139","documentation":"Response-shape guard after a successful Resend broadcast create: the JSON body parsed (or failed to parse) without an `id` field. Without a broadcast id the caller cannot preview, send, or track the broadcast, so the action refuses to return a result — even though Resend may actually have created the broadcast.","triggerScenarios":"Thrown at convex/broadcast/sendBroadcast.ts:121 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the Resend dashboard for a broadcast matching the request — it may exist despite the unparseable response","Treat as a Resend API contract change: inspect the logged JSON and adapt the parser if the field was renamed"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eeab0a219fce0f02a00603b532dbae9041b934ac","analyzedAt":"2026-08-21T16:51:25.751Z","contentChangedAt":"2026-08-21T16:51:25.751Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}