Code Room
Code reviewHard
Question
Review this JavaScript multi-write notifier.
What a strong answer looks like
Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.
Learn the concepts
async function notifyAll(userIds, message) { if (!userIds.length) return []; const results = await Promise.all( userIds.map((id) => pushService.send(id, message)) ); await db.markNotified(userIds); return results;} // callerasync function broadcast(segment, message) { const ids = await db.usersInSegment(segment); const sent = await notifyAll(ids, message); metrics.incr("push.sent", sent.length); return sent;}Run or narrate your approach, then ask the coach.