PracticeCritical Thinking & First Principles
Approve the cleanup?
The payment code nobody can explain
The situation
Jonah has opened a cleanup pull request on the payment integration. It removes a forty-line path that runs when the payment provider answers 'pending': instead of sending the charge again, it waits two seconds and asks the provider for the charge's status, up to three times, then leaves the payment marked pending for the overnight settlement job. Nothing else changes.
Jonah · Engineer: “It’s dead weight. Can you approve so I can get the rest of the cleanup in?”
The code is ugly and untested. Blocking cleanups on archaeology makes a codebase hard to change. You have ten minutes, then you review the pull request.
What you can see (3) · tap a card to read it
›E01 · The justification
The pull request description: 'This looks unnecessary and no test covers it. The provider client already handles errors. Removing to simplify.'
›E02 · The history
The path was added eighteen months ago in a commit whose message is 'fix'. The author left the company last year. No design note or ticket is linked from the commit.
›E03 · What it touches
It is in the charge-creation call. The code is ugly and untested, and it is the only hand-written handling in the integration. Without it, a 'pending' answer goes to the provider client's default handling, which sends the charge again straight away, with no idempotency key. The provider added a webhook for pending charges last year; this code doesn't use it.
Step 1 of 2
What do you spend the ten minutes on?
Your first choice is kept. Changing your mind later counts as a retry.