Why this matters

The bug. forEach ignores its callback's return value. Even if the callback is async and returns a Promise, forEach discards it. await userIds.forEach(...) resolves to await undefined — immediately — while the in-flight emails keep firing in the background. By the time the first email actually sends, the function has returned and the caller has logged 'success'.

The fix. Two correct patterns: Promise.all(arr.map(fn)) for parallel execution, or for (const x of arr) await fn(x) for sequential. Pick parallel for independent work, sequential when order or rate-limiting matters.

Lint. no-async-promise-executor and no-misused-promises flag related shapes — turn them on.

Review heuristic

Read every async function twice: once for missing awaits, once for unnecessary awaits. The first set causes incorrectness; the second set causes performance regressions that nobody notices until the API gets slow.