Loading…
Loading…
Main had a minimal registerUser — just password hash + DB insert. A colleague sent a PR adding welcome email, analytics, and batch user import. Production is already complaining: users register but don't get welcome emails. Walk the diff — hunt for async bugs.
In async code, hunt for: 1. **Function without try/catch** — in handlers and important operations, errors must be handled explicitly. 2. **Async call without await** — fire-and-forget: we don't wait, don't catch, don't know the status. 3. **`forEach` with an async callback** — forEach ignores the returned Promise; the result is unpredictable. 4. **A lost error inside Promise.all** — the first error rejects everything, others can be lost. Walk the code and try to find all four categories.