Choosing the right altitude to fix a bug found in review, not just the fastest patch
In code review, caught a null-safety bug that would have crashed three production components, and fixed the defect class rather than the three instances, by proposing a shared data-layer helper to the PR's author instead of patching each render site myself; one of 310 pull requests I gave an explicit review verdict on that half (702 across four repositories between 2025-03 and 2026-08), measured from the Bitbucket API rather than recalled.
Context
Most of my case studies are about work I owned end to end. This one is evidence of a different, equally important capability: raising the quality bar on someone else's work without taking it over. Code review is where a lot of real engineering judgment is invisible: catching a defect that isn't obviously wrong, deciding to fix the general case instead of the instance, and choosing to suggest rather than rewrite so the author keeps ownership and the lesson. This is part of a sustained practice, over 100 reviews across front end, back end, and tests in a single half, alongside pair programming on critical work, rather than a one-off catch.
Problem
A teammate's pull request rendered a list of items after filtering it, but a nearby piece of logic in the same component still referred to the length of the original, unfiltered array. Both lines were locally correct, and neither was wrong on its own, but together they encoded an assumption that the two values would always agree. They wouldn't: the moment the filter actually removed an item, the two derived values would diverge, and three components shared this exact pattern.
03Constraints
Decision
I recognized the shape of the bug before deciding what to do about it: two values derived from the same source, read independently, with no guarantee they'd stay in sync. It was the same kind of problem I've solved architecturally elsewhere by giving a derived value a single computation path.
05Trade-offs
Impact
07Lessons Learned
Reusable engineering knowledge I carry forward from this: