2 ms·
In my experience a missing await is the most common bug. Inadvertently run something in the background for an instant race condition, and hard to find. I think
by skybrian 3y ago
In my experience a missing await is the most common bug. Inadvertently run something in the background for an instant race condition, and hard to find.
I think there should be no default for how to call an async function from another async function. Both waiting for a response and not waiting (starting a "background task") should be acknowledged in the code. Perhaps not allowing a promise return value to be silently dropped would be enough.
Sync functions are easy in comparison.
Edit: I guess there is a lint rule:
https://typescript-eslint.io/rules/require-await/ https://typescript-eslint.io/rules/require-await/