Invental/Review lessons

Code review lessons.

What reviewers actually catch in active product codebases, rewritten as reusable patterns. Each lesson has the bug in one sentence, a before-and-after pattern in our own code, and a yes/no check you can run on your app today.

79 lessons · 8 themes · 133 checks Request a review ↗
AI review bots
65%
of 2,675 review threads were opened by an AI bot
Caught by bots
30
of these 79 lessons came from an AI bot’s finding alone
Caught by both
34
needed a human and a bot
Humans only
15
found only by a human reviewer

Bots tend to catch mechanics: races, missing guards, wrong status codes, leaks. Humans tend to catch business rules and scope: who may do what, money in flight, what the change should not have touched. In 34 of the 79 lessons below, it took both.

Drawn from merged pull requests and their review threads in active open-source product repos (Next.js, Prisma, Postgres, Node queues, React and Vue). The code on these pages is our own illustration, not copied from any project.

Start from a theme

09 lessons

Check, then act on stale state

Reading a status and then writing by ID is a race. Lessons and checks for putting the condition in the write, or locking the row.

Open the theme →
07 lessons

Background jobs when something fails

Claims never released, dedup that ignores running jobs, jobs that re-queue forever. Review lessons and checks for queues and workers.

Open the theme →
21 lessons

Code that silently does the wrong thing

Schemas that drop fields, NULLs that skip filters, loading read as not found. Lessons and checks for code that fails without an error.

Open the theme →
18 lessons

Trust boundaries the server must hold

A disabled button is not a permission. Lessons and checks for authorization on side paths, untrusted input, and server-only fields.

Open the theme →
04 lessons

Tests that can never fail

Negative tests with nothing to exclude, mocks with the wrong shape, assertions on status codes only. Lessons and checks for tests that prove something.

Open the theme →
08 lessons

Writes that span systems

When one operation touches a database, object storage and a third-party API, every crash point needs a recoverable state. Lessons and checks.

Open the theme →
10 lessons

Client state that goes stale

Late async results, debounced copies read as truth, caches that outlive the account that filled them. Lessons and checks for frontend state.

Open the theme →
02 lessons

Accessibility and UI behaviour

Div buttons that ignore the keyboard, menus that offer actions that throw, focus that goes nowhere. Lessons and checks for a UI that keeps its promises.

Open the theme →

Checklist: 10 ways your app says “success” and does nothing →

All lessons

Want a second pair of eyes on your code?

Senior reviewers who work with Invental check pull requests, architecture and AI-built apps. Tell us what you are building and we confirm scope before anything starts.

— Get in touch
hi@invental.co ↗
— Or
— What to include

A link or short description of the code or system, what you want checked, your stack, and when you need the answer. No repository access is needed until scope is agreed.

— Or leave a note
We reply within one business day.