Have You Heard the Joke About Async Debugging? I Promise It Is Good
summary
Most apps contain subtle async bugs: HTTP responses arrive out of order, causing stale search results; fix shown by canceling prior fetches with AbortController/AbortSignal and checking error.name === AbortError instead of swallowing exceptions. Another common bug is silent failures from automatic promise flattening — returning a Promise from an async function can bypass try/catch unless code uses return await (or an ESLint rule). Debugging relies on network waterfalls, DevTools async stacks, and targeted console logs.
AI-written summary · about
chapters (12)
- 0:00Introduction
- 1:03Async bugs are everywhere
- 2:49Simple search example
- 4:11The async bug revealed
- 6:58Fixing with AbortController
- 9:25Handling abort exceptions
- 11:34Promise flattening trap
- 13:59Why try-catch fails
- 16:50Promise flattening explained
- 18:55Never rely on flattening
- 20:01Key takeaways
- 21:45Debugging async code
related talks
25mDebugging async JS
26mNow and .then: Debugging Async JS
25mNow and .then: Debugging Async JavaScript
25mNow And Then Debugging Async JS
28mError handling: doing it right!
14mThe Promised Path to Async, Awaits
43mAvoid the headaches – make your asynchronous code look synchronous!
40mManeuvering Errors within the Bowels of JavaScript
