Skip to content

Async

The promise nobody waited for

Work started and not awaited, and the assertion that runs before it lands.

10 minutes · floating promises · fire and forget · ordering by accident

Calling is not waiting

Calling an async function starts it and hands you a promise. If you do not await that promise, the function keeps going — but so does yours, and the two are now racing. Whatever the background work was supposed to have finished may not have.

It usually appears to work. The background task is short, the thing that depends on it is slightly slower, and the ordering holds by luck. Then the work gets slower, or the machine gets busier, and the luck runs out.

Everything you do here stays in this browser.