Which fix removes the bug?
const [a, b] = await Promise.all([one(), two()]); // two() rejects, one() keeps running
- Use allSettled and check
- Await the calls in order
- Wrap each in a timeout
- Return early on reject
Promise.all rejects on the first failure and leaves the other work unhandled and unreported.
Play Problem Solving ▸