
Engineering Notes from Production
Silent failures, LLM quirks, Firebase patterns and deploy traps I hit in real products, each with the fix and the reason it happened in the first place.
Mirror Your Site as Markdown
How varstatt.com serves every page as machine-readable markdown — prebuilt at deploy, discoverable via headers, and ready for agents.
Errors That Never Left the Device
Eleven silent failure paths in a clinical iOS app. None surfaced as a backend alert, so every one of them looked like a successful upload.
Works Locally, Fails After Deployment
File tracing misses runtime paths, Cloud Run changes the working directory, CloudFront eats routes, and OG images silently vanish — four failures that pass every local test.
When the LLM Remembers Too Much
A vendor rate becomes a budget constraint and reasoning leaks across step boundaries — two failures from implicit state crossing where it shouldn't, and the architecture that fixed both.
Null Bytes, Dead Streams, Last Chunk
SSE adds overhead for mixed events, silent streams hang without error, and the last audio chunk vanishes on page close — three LLM streaming fixes.
200 OK, Data Wrong
Imagen rewrites your prompt, Lambda corrupts your binary buffer, GSC returns empty rows, and structured output truncates without error.
Filling Forms No Tool Can Template
Every tender form is different, templating tools need placeholders you can't insert, and markdown round-trips destroy the document.
SVG Animation Is Not DOM Animation
Rebuilding an old chart race challenge in React taught me five things SVG handles differently than the DOM. Coordinates, transforms, text, and more.
npm Trusted Publishing from GitHub Actions
Run npm publish from GitHub Actions over OIDC, with no npm token to store. Miss one requirement and npm returns a misleading 404.
It Works, but You Can't Ship It
Two AI providers fill the form correctly. Both route document data through global endpoints that don't meet every customer's residency policy.
Three Ways the Wrong Value Won
A race condition, a stale default, and a spread operator each delivered the wrong value to production. None threw an error.
An Empty AI Response Corrupted Chat History
Gemini returned HTTP 200 with zero content. I saved the empty response to conversation history. The chat never recovered. Here's what went wrong.
Three Bugs That Were Actually My Prompts
Three debugging sessions where I chased AI misbehavior for hours. Each time the model was executing my instructions exactly as written.
The Production Bugs That Never Threw an Error
Six bugs across OAuth, Next.js, launchd, n8n, browser APIs, and OpenAI. Every log said success. Every result was wrong.
Firestore Transactions: Race Conditions Between Cloud Functions
A runTransaction example for the case where two Cloud Function instances race to create the same external resource and one needs to win.
Merging Two Firestore Listeners for Cross-Field OR Queries
Firestore can't OR across different field types in a real-time query. Two parallel listeners merged client-side can.
SwiftUI Is Like React + CSS-in-JS
I had to jump into an iOS codebase with no SwiftUI experience. The fastest way in was mapping everything I already knew to the Swift equivalent.
Using Shared Packages in Firebase Monorepos
Firebase breaks with file:../shared deps. Use npm pack + tarball approach: preinstall script creates .tgz locally, gets included in deploy.
Build Apps Like LEGO Bricks
Use ports & adapters architecture to swap AI providers like LEGO bricks. Avoid vendor lock-in, optimize costs, test new models easily.
When "Polish over Security" Costs Real Money
Client wanted to "polish features first, security later." Found exposed OpenAI API key in frontend code. Anyone could steal it and rack up unlimited charges.
Fidder Overengineering Made Me Pay
Reduced Fidder's maintenance costs $17/month → $1/month by fixing architectural mistakes, like expensive Firestore secutiry rules and unnecessary VPS-polling.