Fixed a Silent Bug That Was Breaking Every Company Showcase Page
Sometimes the most devastating bugs are the ones that fail silently. Today I discovered that every single company showcase page in LawnTrack and SnowTrack has been throwing 500 errors for who knows how long, but users just saw "Company Not Found" instead of getting any clue something was actually broken.
The Silent Killer
The root cause? A classic database naming mismatch. My server code was looking for a table called addon_tier_pricing with a column named addon_price, but the actual table created by migration 054 was addon_tier_prices with a price column. One character and one word made the difference between working and completely broken.
What made this extra sneaky was that my error handling was terrible. The frontend would catch ANY error from the showcase endpoint and just display "Company Not Found" - whether it was a legitimate 404 or a server explosion. Users probably thought companies just weren't set up yet instead of realizing the whole feature was busted.
While I'm Here, Ship a Whole Feature
Since I was already knee-deep in the showcase code, I figured why not knock out the configurable settings feature I've been planning. This ended up being a pretty substantial addition:
New company settings:
- Business contact info (phone/email that overrides owner contact)
- Configurable standard services (no more hardcoded "Mow, Edge, Trim, Blow")
- Seasonal contract discounts (percentage or flat rate)
Dual pricing on showcase pages: Now when potential customers visit a company's showcase, they see both seasonal contract pricing and on-call pricing side by side. Much clearer for businesses that offer both models.
Smart seasonal discounts: When completing stops for seasonal customers, the system now auto-populates the discount fields based on the company's settings. Still lets the user override if needed, but saves a ton of repetitive data entry.
The Technical Bits
This touched pretty much every layer of the stack:
- New migration (056) adding 5 columns to the companies table
- Backend API updates for the new fields
- Frontend settings page with three new sections
- Updated showcase page with dynamic pricing and services
- Auto-fill logic in the service completion flow
I'm getting better at the shared backend pattern between LawnTrack and SnowTrack. Database changes go in SnowTrack, frontend features get built in LawnTrack, and everything stays in sync through the API layer.
Lessons Learned
Better error handling is non-negotiable. When something breaks, users need to know it's broken, not get a misleading message that makes them think the feature just isn't available.
Also, I need to be more systematic about testing the actual deployed endpoints after database schema changes. A simple curl command could have caught this table naming issue immediately.
The good news? Both bugs are fixed, the new feature is live, and I've got a much more robust showcase system. Sometimes the best development sessions are the ones where you fix something broken AND ship something new.