Webhook charge without await
An AI agent wrote this Node.js webhook handler that charges a customer and then logs the event. It says the try/catch makes it robust. Review it.
What breaks, and what symptom shows up in prod?
Implement
find_floating_promises(body_lines: list[str], async_functions: list[str]) → list[int]Examples
in
[["const { customerId, amount } = req.body;","chargeCustomer(customerId, amount);","await db.insert('charges', { customerId, amount, status: 'ok' });","res.status(200).json({ ok: true });"],["chargeCustomer","db.insert"]]out[2]in
[["await chargeCustomer(customerId, amount);","await db.insert('charges', { status: 'ok' });"],["chargeCustomer","db.insert"]]out[]What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it (tests, edge cases, reading critically), and how you’d re-prompt or decompose to get it right.
0:00 of about 16 min
Vibe & agentic: describe the solution in plain language (or narrate it) and the coach grades your approach.
Which questions mattered is sealed until you submit. Telling you now would just be handing over the edge cases.
Run or narrate your approach, then ask the coach.