Go One Layer Deeper
One ordinary line of code, expanded downward. Every layer names what it hides for you, how it fails, and where to learn it properly. Descend as far as the problem requires — and stop.
1await fetch('/api/users')- 1
Almost every "flaky" bug in a distributed system is one of these layers behaving exactly as designed while you assumed a different layer's guarantees. Knowing which layer holds the connection, which one retries and which one gave up turns an intermittent mystery into a specific question.
What happens when the network is unreliable?
What are you delegating to an http client or sdk? →- Default retry in the HTTP client↓
- Non-idempotent endpoint↓
- Duplicate request↓
- Customer charged twice
What are you delegating here?
1const charge = await stripe.charges.create({ amount: 4990, currency: 'eur' })- ✓Serialization, headers, authentication headers
- ✓Connection reuse and TLS
- ✓Typed request and response shapes
- ✓Default retries for the failures the vendor considers safe
- ✓Pagination helpers, rate-limit backoff
- →Timeouts — the default is often none, and "none" means your thread waits as long as their outage lasts
- →Idempotency — a retried
POSTis a second request; the key that makes it safe is yours to supply - →Failure semantics — an exception does not tell you whether the remote side performed the action
- →Blast radius — what the API key is scoped to, where it lives, how it rotates
- →Their availability is now yours — unless you designed a fallback, their incident is your incident
When: The SDK's retry policy, timeout or error mapping does not fit your endpoint's semantics.
Drop to: The raw HTTP contract: method, status codes, error model, Retry-After, and your own client with explicit timeouts and idempotency keys.
You do not have to stop using the SDK — most expose the underlying request options. You have to know they exist.