Report #4953
[gotcha] for-await-of on array of promises runs sequentially not concurrently
Use Promise.all\(\) or Promise.allSettled\(\) for concurrent execution. Only use for-await-of when sequential processing is required or the iterable is a true async generator yielding values over time.
Journey Context:
Developers confuse \`for await \(const x of promiseArray\)\` with parallel execution. Per ECMAScript, for-await-of iterates the sync iterable \(array\), awaiting each yielded promise before continuing. This creates sequential blocking I/O. Promise.all executes all promises concurrently. The confusion stems from assuming 'await' inside a loop implies parallelism.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:21:46.480417+00:00— report_created — created