The worst billing bug I found last month had no victims
My gym sells memberships from its website. Somebody picks a plan, enters a card, and money is supposed to arrive on a schedule after that.
Last month I went through the billing code deliberately, not because anything had broken, and found that one of those paths had never charged anybody. A monthly membership bought from the marketing site created the member, took the first payment, and then never set up a renewal. It had been that way since 15 May.
The number of people affected was zero. Not zero complaints. Zero people had bought a monthly membership through that particular path in three and a half months, so the bug had never had the chance to cost anything.
That is the most useful bug I have found in a while, and the reason is uncomfortable.
Silent failures do not queue up politely
Most software failures announce themselves. A page 500s, somebody cannot log in, a button does nothing, and a customer tells you within the hour.
Billing failures split into two kinds and only one of them behaves that way.
Overcharging is loud. Charge a member twice and you hear about it the same morning, in a tone you will remember. That feedback loop is fast, which means overcharging tends to get found and fixed quickly.
Undercharging is silent. Nobody emails to say their gym forgot to bill them. The revenue simply does not arrive, and because it never arrived there is no anomaly in the numbers to notice. You cannot see the absence of a transaction that was never created. It looks exactly like a member who did not sign up.
So the bug survives until either you go looking for it, or enough of it accumulates that the shortfall becomes visible in aggregate, by which point you are recovering months of money from people who reasonably assumed they were paid up.
Mine had been latent for three and a half months and would have kept going indefinitely, because the only thing standing between it and real money was that nobody had walked down that path yet.
Three more, found in the same pass
Once I was in there, the same review turned up three others. None of them was dramatic. All of them are the kind of thing that quietly erodes either revenue or trust.
Credits were checked after the card, not before. When a draft invoice fires, the system asked "does this member have a saved card" before it asked "is this invoice already covered by account credit". A member whose balance fully covered the charge, but who had no card on file, would fail to pay something they did not owe money for. The fix is a reordering: check credit first, and a fully-credited draft settles without a card ever being involved. This one had teeth, because the gym issues credit every month through the consistency rewards programme.
Renewals were drifting a day. The weekly billing run compared dates in UTC while the gym runs on Pacific time. For part of the year that shift is enough to push a renewal intended for Sunday onto Monday. Nobody loses money, but a member who expects a Sunday charge and sees a Monday one has been given a small reason to distrust the statement, and that is not free either. The comparison now happens in Pacific.
The signup cards were technically honest and practically misleading. The gym bills full weeks and does not prorate. That is a deliberate policy, not an accident. But a person signing up on a Saturday would see "Start today" and pay a full week's rate for two days. Nothing was wrong with the charge. Everything was wrong with the presentation.
That last one did not get a price change. Friday, Saturday and Sunday now lead with "Start next week", and "Start today" is demoted and carries explicit copy saying how many days are left this week and that it renews Sunday at the full weekly rate. The policy is unchanged. The customer can now see it before they pay instead of after.
The distinction worth keeping
Three of those four are code defects. The fourth is not, and I nearly filed it as one.
"Start today charges a full week for two days" reads like a bug when a customer says it. It is actually a pricing policy meeting an interface that failed to explain it. Fixing it in code, by prorating, would have quietly reversed a business decision I had made on purpose.
That is a trap worth naming, because it runs the other way too. Plenty of things get shrugged off as policy that are really defects. The test I use now is whether the outcome is what I would choose if the customer could see the whole mechanism. If yes, it is a policy problem and the fix is to show them. If no, it is a bug.
What this does not prove
I found these by reading, not by measuring, and I want to be honest about how weak that is as a method.
Zero victims is a fact about my situation, not a compliment to my process. That path had no traffic. Had the marketing site been converting monthly signups all summer, the same bug would have been an expensive mess and the review would have been a post-incident cleanup instead of a quiet afternoon. I got lucky about which path was cold, and luck is not a control.
I also cannot claim this pass found everything. It found four things because I looked at four areas. There is no test in this system that would have caught the never-billed path, and I have not added one. The honest state is that I read some code carefully once.
The thing I would actually recommend is smaller than "audit your billing". It is this: for every path that is supposed to create a recurring charge, go and confirm a recurring charge exists. Not the first payment, the second one. The first payment works, or the member would have told you. It is the second one that fails silently, and the only way to know is to go and look at whether it happened.
The uncomfortable part
The reason this is worth writing down is not the fix. It is that my monitoring is built around things going wrong loudly.
Errors get logged. Failed payments get surfaced. Nothing anywhere in the system asks the question "should this member have been charged this month, and were they". Absence has no error message, so it has no alert, so it has no dashboard.
I have not solved that. Writing it down is the first step toward it, and shipping the reconciliation is a different post, hopefully one where I can show it caught something.
First published on ravikantdewangan.com.

