PR REVIEWawait Inside forEach — Silent Async Failure#204StripeLinear
00:00Junior~10 min
PULL REQUEST
Open#204 · 1 commit
await Inside forEach — Silent Async Failure
junior-dev-99 wants to mergefeature/order-email-confirmationmain
JU
junior-dev-99
1 file changed · 2 hours ago
YOUR MISSION
A junior dev refactored the order-fulfilment service to send confirmation emails after each order is marked shipped. QA reports emails are never sent, yet CI is green and no errors appear in logs.
Junior~10 min
HINTS (0/3 used)
REVIEWING AS
SR
Senior Engineer
@ Stripe · Backend Platform
src / services / fulfilment.ts+3 3
12
12
async function fulfilOrders(orders: Order[]) {
13
13
await db.markShipped(orders.map(o => o.id));
14
for (const order of orders) {
+
15
await sendConfirmationEmail(order);
+
16
}
+
14
+
orders.forEach(async (order) => {
+
15
+
await sendConfirmationEmail(order);
+
16
+
});
+
17
17
}
Click any changed line (+/−) to flag an issue · or Approve if everything looks safe