Part III — The Speed · Lesson 7.4
Fixing
In one lineStop the bleeding first, find the cause second — rollback beats a clever hotfix at 3am.
Where you've seen itTypeError: undefined is not a function at t.n (main.7b2e04.js:1:48211) — useless, until source maps turn it into Cart.tsx:82.
Diagram
Lessons in this diagram4.6 Test-Driven Development
Lessons in this diagram3.5 Client-side Security
TRIAGE QUESTIONS, IN ORDER
1. How many users, which routes, which releases? scope
2. Did it start with a deploy? ← usually yes
3. One browser/OS/device class only? compatibility
4. One region or CDN edge? infra
5. Third-party script or API involved? not yours
6. Reproducible locally with the same flags? ← A/B variant mattersHow it works
- Acknowledge and own it. An unowned alert is an unhandled alert.
- Scope before fixing — percentage of users, routes affected, and whether it correlates with a release.
- Mitigate immediately: roll back, or flip the feature flag off. Both are faster and safer than a rushed patch.
- Diagnose with mapped stacks, breadcrumbs, and traces, reproducing with the same feature flags and experiment variant.
- Write a failing test first, then fix (4.6). Finish with a blameless postmortem whose action items have owners and dates.
Trade-offs
| Mitigation | When it's right |
|---|---|
| Rollback | Regression from a known recent deploy |
| Feature flag off | Feature is isolated and flagged |
| Hotfix forward | Rollback is impossible (migrations) |
| Scale up / rate limit | Load-driven, not code-driven |
Design for mitigation in advance: ship behind flags, keep deploys small and reversible, and make rollback a one-command operation. The quality of your 3am response is decided weeks earlier.
Interview angle
"Production error rate just spiked. Walk me through your response."
- Acknowledge, then scope: how many users, which route, which release — and check what deployed in the last hour.
- Mitigate before diagnosing: roll back or kill the flag, so the investigation isn't racing against user impact.
- Then map the stack, reproduce with the right flags, add a failing test, fix, and run a blameless postmortem.
Recap
- Mitigate first, diagnose second — rollback is a legitimate fix.
- Source maps uploaded at build time turn noise into line numbers; never serve them publicly.
- Your incident response quality is determined by decisions made long before the incident.