Writing
Notes from running Discord apps in production
Each of these started as something that broke, surprised me, or took far longer than it should have, in an app real people were using. They explain what happened, how I found out, and the fix I'd use again. The numbers come from production logs and measurements, not estimates.
- Two moderators click Close at once: a compare-and-swap state machine in SQLiteHow a Discord ticket bot stays correct under double clicks, stale buttons and restarts: every state change is one guarded UPDATE, and only the winner acts.13 November 2026 · 6 min read · Rust, SQLite, Discord API
- ResizeObserver loop completed with undelivered notifications: the cause and the fixWhat the ResizeObserver loop error means, why setting state inside the callback triggers it, and the one-frame deferral that stops it reaching your error handler.13 November 2026 · 5 min read · JavaScript, Web, Front end
- Why focus() silently failed for every reduced-motion userA blanket prefers-reduced-motion rule made visibility a transition, so focus() on a just-revealed menu did nothing and keyboards couldn't open any menu.13 November 2026 · 4 min read · Accessibility, CSS, Web
- Cutting 30 KB from a boot bundle by moving module boundariesLazy loading didn't shrink my first-load JavaScript until I learned that a bundler places each module in one chunk, whole. How to find and split those modules.13 November 2026 · 6 min read · Performance, Web, Front end
- How a trailing space in an env file turns a security check offREQUIRE_MANAGE_GUILD=true with a trailing space parsed as false. How lenient env parsing fails silently, and the rules that make a server refuse to boot instead.13 November 2026 · 5 min read · Operations, Rust, Configuration
- Preact's useId gave my dialogs the same ids as the page behind themuseId in Preact counts per render root, so a dialog rendered in its own root repeats ids already used on the page. How to detect duplicate ids and replace the hook.13 November 2026 · 5 min read · Preact, Accessibility, Front end
- Keeping a TypeScript validator and its Rust port in agreementThe same validation rules live in a TypeScript web app and a Rust server. A generated test corpus keeps them identical, and UTF-16 length is the first trap.13 November 2026 · 6 min read · Rust, TypeScript, Testing
- Nested deadlines: answering Discord interactions inside three secondsRouting Discord button clicks through a dispatcher to plugin services inside the 3-second window: failure classes, safe retries and nested timeouts.9 November 2026 · 7 min read · Discord API, Rust, Reliability
- Measuring how Discord renders a message instead of guessingKeeping a Discord message preview faithful by measuring Discord's own client: the workflow, media gallery layout rules, failure states and markdown quirks.9 November 2026 · 5 min read · Discord, Components V2, Front end
- Your crash reporter is paging you for someone else's codeExtensions and third-party scripts throw into your page's error handlers. How to attribute a JavaScript stack trace to its real owner, and why the server decides.9 November 2026 · 6 min read · JavaScript, Observability, Web
- When a deploy deletes the chunk an open tab still needs"Failed to fetch dynamically imported module" after a deploy: why code-split apps hit it, how to recover safely, and how to tell a stale tab from a bad release.9 November 2026 · 7 min read · Web, Deployment, Service workers
- A dropped DNS packet that looked like a Discord outageA 5-second "connect timed out" to discord.com was a DNS stall inside Docker. How one lost UDP packet stalls lookups, and how serving stale answers fixes it.9 November 2026 · 5 min read · Operations, DNS, Rust
- Three ways a reverse proxy invents a 502Caddy logged 502s for requests my backend had answered. Unread request bodies, container restarts and HTTP/3 clients hanging up, and how to fix each.9 November 2026 · 5 min read · Operations, Caddy, HTTP
- Discord keeps your webhook's avatar_url, not the image, so host it foreverDiscord stores your webhook's avatar_url, not the image. Why uploaded avatars break later, the silent size limits, and how to host them permanently.9 November 2026 · 4 min read · Discord API, Webhooks, Rust
- Chrome's page translation versus your virtual DOMWhy Chrome's page translation makes Preact and React throw "Failed to execute 'insertBefore' on 'Node'", and a narrow DOM patch that fixes it safely.9 November 2026 · 5 min read · JavaScript, Preact, Web
- A stale browser tab deleted four hours of saved draftsTwo tabs, one localStorage key, and a save that wrote an old list over newer data. Making browser storage safe across tabs, plus two IndexedDB traps.9 November 2026 · 4 min read · JavaScript, Web, State management
- A short page is not the last page: counting a Discord bot's serversMy bot's server count sat at 199 for weeks, then jumped to 344. Paginating GET /users/@me/guilds correctly, and a per-token rate limit I raced myself.9 November 2026 · 5 min read · Discord API, Rust, Rate limits
- Opening the Discord app from a web page without opening the website tooAn "Open in Discord" button should launch the app or the website, not both. The discord:// race, cold starts on Windows, and each browser's popup limits.9 November 2026 · 4 min read · JavaScript, Discord, Browsers
- Stripe Checkout: a 100%-off promo code that doesn't ask for a cardA 100%-off-forever promo code still showed a card form in Stripe Checkout. Why, and the API details that let your own promo field skip the card.9 November 2026 · 4 min read · Stripe, Payments, Rust
- An event parameter named "source" rewrote my GA4 traffic attribution17% of my GA4 sessions were credited to traffic sources called "gallery" and "seo". The cause was an event parameter name. Which names to avoid.9 November 2026 · 4 min read · Analytics, Google Analytics, Privacy
Subscribe with the RSS feed. Found a mistake? Email [email protected] and I'll correct it.
