A bad review would have sent her customer to another business's front desk
A customer leaves a two star review for a hair salon. The software notices, and sends the apology text it is supposed to send: sorry we missed the mark, please call us so we can put it right.
The number in that text belonged to a different company. A head spa, in a different neighbourhood, that does not cut hair and has never heard of this person.
That message was never sent. I want to lead with that, because the rest of this post is about a defect and it would be easy to write it as an incident. It was not one. It was found during onboarding, two days before the second business sent a single message to a single customer. But it was one configuration flag away from being real, and the reason it existed is the most ordinary reason in small software: the platform had been built for one business, and for a year every default it had was that business.
The setup
The platform runs bookings, reminders, receipts, review requests and a guest portal for appointment businesses. It had one real tenant for its whole life. This month a second one came on, a salon, with its own brand, its own hours, its own messaging provider already wired up.
When you build for one customer, you do not write defaults. You write the answer. The address constant was their address. The phone constant was their phone. The sender name on outbound mail was their name. Six message templates ended with the first business's name because that was simply the name of the business the software served.
None of that is negligence, and I would build it that way again. It is what lets you ship something real for a real business in the first place. But the bill arrives all at once, on the day customer number two logs in.
The sweep, and the rule
Before letting the second business go live I ran a sweep across every place the software speaks to a customer: email, SMS, the calendar feed, the guest portal, and every call site that sends mail.
It found 19 confirmed places where one business's identity could reach another's customers. That 19 is my own count of code sites from my own sweep. It is not an audited figure and nobody else has checked it.
The rule I applied everywhere was one line: a missing tenant value omits the element, it never borrows the incumbent's.
That sounds obvious written down. It is the opposite of what almost every fallback in the codebase did. A fallback exists to keep something from looking broken, and the nearest sensible value to fall back to was always the first tenant's. So the address constant and the phone constant became empty strings. The default mail sender became the platform, not a paying client, so a forgotten sender field can no longer send as somebody's business. The calendar feed stopped emitting a location line at all for a tenant with no address, rather than emitting the other tenant's. Hardcoded trading hours came out of the guest portal. The neighbourhood name in the portal copy became a per business value. Storefront image, wayfinding text and the find us link moved onto the business record.
The worst one was not email
Email was the obvious place to look and most of the 19 were there. The one that would actually have reached a person was a text message.
The platform has a master notification switch, which is how a new tenant gets set up safely: wire everything, leave the switch off, turn it on when the business is ready. The review thank you SMS was not behind that switch. The second business already had its messaging sub-account connected, because you connect that during setup.
So the guard I was relying on to make onboarding safe did not cover the one message type that carried another company's phone number. Turning on reviews for the new tenant would have sent it for real, to somebody already unhappy enough to leave two stars.
I am not going to dress that up. The safety mechanism had a hole in it and I found the hole by looking rather than by being told.
The tests were asserting the bug
This is the part I keep thinking about.
The self tests did not miss this. Several of them were actively defending it. One test asserted that a tenant with no address rendered byte for byte identically to the first business. That test passed for a year. It was written when there was one tenant, where it is a perfectly reasonable regression check, and it quietly became a test that the leak was still working.
Another class was worse because it failed silently in the other direction. Several tests checked output by comparing against the phone constant. Once that constant became an empty string, the check became a test for whether a string contains the empty string, which is always true. Those tests kept passing and had stopped asserting anything at all. They now compare against the literal value instead.
A test suite written when you have one customer encodes that customer as the definition of correct. It will not warn you. It will vouch for the problem.
There was a second class of the same mistake found in the same push, inside a single business rather than across two. If a guest typed an email address at public booking that already belonged to a different customer of that salon, the booking could be filed onto that other person's record. A booking now reuses a matched record by its id and never through a typed email address, and an anonymous online booking writes nothing back to a stored record.
How it was verified
Every notification kind, the calendar feed and the guest portal were rendered for all three tenants from live data rather than fixtures. The second business and the demo tenant show zero markers belonging to the first business across 12 rendered outputs each. The first business keeps all 44 of its own, which is the half people forget to check: it is easy to fix a leak by deleting the content, and then the original customer's messages go out blank.
The timeline is the part that decides whether this is a near miss or an incident. The isolation work landed on 17 and 18 September. The second business's first customer message went out on 20 September. Seven messages total, all on that day, all after the fix.
What this does not prove
It does not prove the software is now correctly multi tenant. It proves that 19 specific places were found and closed, and that a sweep I designed did not find a twentieth. A sweep only looks for what you thought to look for, and the leak that gets you is the one in the category you did not enumerate. I would not be surprised to find more.
It does not prove anybody was ever at risk in the sense of data being exposed. Nothing confidential moved between tenants. Everything that leaked was published marketing information: a business name, a public phone number, a storefront photo, trading hours, a neighbourhood. The damage would have been to the second business's credibility with its own customers, not to the first business's privacy.
And there is no cost figure in this post, because nothing happened. No message went to the wrong person, no customer was confused, no refund was issued. I cannot tell you what this saved. I can only tell you what it would have looked like.
The argument against me
You should have built it multi tenant from the start. This is a solved problem, the patterns are thirty years old, and discovering your defaults are one customer's data on the week your second customer arrives is not a war story, it is a schedule slip you caused yourself.
That is fair and I will not argue the principle. What I will argue is the counterfactual. Building the tenant abstraction first, for a customer base of one, on a product that might not have found a second, is how you spend a year on architecture for a business that never arrives. The first business is live, has taken 177 online bookings in six weeks, and paid for the product that now has a second tenant. It exists because I built the specific thing.
The defensible position is not that this cost nothing. It cost a week and it came with a near miss. The defensible position is that the bill was smaller than the alternative, and that the way to keep it small is to pay it deliberately, before the second customer is live, rather than discovering it through a support call.
What carries over
Your defaults are your first customer. Go and read every constant, every fallback and every piece of copy that an empty field falls back to. Whatever is there is what your next customer inherits.
Prefer omitting to guessing. A calendar event with no location is mildly unhelpful. A calendar event with the wrong company's address sends somebody across a city.
When you change a constant to an empty value, re-read every test that compares against it. Emptiness is the identity element for a lot of string operations, and tests that go quiet look exactly like tests that pass.
And check the safety switch covers everything you think it covers. Mine covered most message kinds, which is the same as not covering them.
If you are putting a second customer onto software that has only ever had one, that is the kind of work I do at Autosterea.
First published on ravikantdewangan.com.

