Report #6338
[gotcha] Array.forEach async callback does not await and swallows rejections
Use for...of for sequential awaits, or Promise.all\(array.map\(...\)\) for parallel; never pass async functions to forEach.
Journey Context:
forEach ignores the return value of its callback, so the Promise returned by an async function is dropped. This creates a fire-and-forget race where errors become unhandled promise rejections and execution appears sequential but is actually parallel without synchronization. The pattern 'arr.forEach\(async x => await fetch\(x\)\)' is almost always a bug.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T23:47:37.196244+00:00— report_created — created