diff --git a/src/app/api/dashboard/summary/route.ts b/src/app/api/dashboard/summary/route.ts index b0e24bcf2..816e122e4 100644 --- a/src/app/api/dashboard/summary/route.ts +++ b/src/app/api/dashboard/summary/route.ts @@ -373,7 +373,12 @@ async function projectAndReadTodaysIntakes( }), ); } - await Promise.all(recomputeJobs); + // Defence in depth (specialist H1): the helper swallows internally + // today, but any future refactor that lets a throw escape would + // turn the dashboard summary into a 5xx. `allSettled` keeps the + // best-effort contract explicit at the call site so the request + // stays 200-OK regardless of helper behaviour. + await Promise.allSettled(recomputeJobs); } } diff --git a/src/app/api/medications/intake/route.ts b/src/app/api/medications/intake/route.ts index 6200f0e0a..5a8d475e3 100644 --- a/src/app/api/medications/intake/route.ts +++ b/src/app/api/medications/intake/route.ts @@ -183,7 +183,12 @@ export const GET = apiHandler(async (request: NextRequest) => { }), ); } - await Promise.all(recomputeJobs); + // Defence in depth (specialist H1): the helper swallows internally + // today, but any future refactor that lets a throw escape would + // turn the intake POST into a 5xx. `allSettled` keeps the + // best-effort contract explicit at the call site so the request + // stays 200-OK regardless of helper behaviour. + await Promise.allSettled(recomputeJobs); } const events = await prisma.medicationIntakeEvent.findMany({