Anh Tran dev notes

Production bugs from mobile and backend work, written up with the fix and how it was checked.

Field notes, Hà Nội

Bugs I fixed in real apps, written up so the next person can skip the week.

I'm Trần Thế Anh, a software engineer. For the past few months I've been the developer behind several consumer mobile apps and the internal platform that runs them. Each note here starts from something that broke, shows the error or symptom, the change that fixed it, and what I ran afterwards to be sure.

The topics follow the work: subscription webhooks, Supabase row-level security, AdMob mediation, Android crashes that have no line of app code in the stack, GA4 event design, end-to-end tests on a real phone, chat memory for LLM characters, and RAG on Postgres. Code samples are small rewrites written for these pages, not excerpts from private repositories. More about the author.

Latest notes

  1. 12 Hybrid search on Postgres with pgvector: the Prisma migration that dropped the HNSW index and nobody got an error A hybrid pgvector query that merges vector and full-text hits by rank, the settings that make a filtered HNSW search return enough rows, and the Prisma drift that silently deleted the vector index and sent production to a sequential scan. 30 November 2026 · 6 min · RAG / Postgres / Prisma
  2. 11 Why returning from a browser or the share sheet shows an app-open ad: marking external hand-offs in Flutter A resume-ad gate that fires when users come back from a web page, a mail app, the share sheet or a purchase. The fix is a mark with its own end point, a source scan that fails on any new exit, and a few traps with browser bottom sheets and SDK-owned flags. 30 November 2026 · 6 min · Flutter / Ads / Mobile
  3. 10 Long-term memory for an LLM chat backend without losing the prompt cache: fold in blocks, claim before you write A sliding window that drops one message per turn gave a 0 token cache hit. Moving the window in blocks and folding old turns into memory in the background brought it to 88 to 94 percent. The claim, retry and forgetting rules that keep that background job honest. 30 November 2026 · 6 min · LLM / Backend / Postgres
  4. 09 Maestro on a real Android phone: fast flows, rapid-tap tests and counting crashes instead of trusting green Why Maestro idles for seconds before and after taps, which two waits to remove, how to write a flow that taps ten to thirty times without settling, and why the crash buffer, not the flow colour, is the verdict. Includes the sed trap that made a mutation test pass for nothing. 30 November 2026 · 5 min · Testing / Android / Maestro
  5. 08 RevenueCat in an app with accounts: restore behavior, guests and the Pro subscription two users shared Why the default RevenueCat restore behavior lets two accounts hold the same subscription, which setting fixes it for apps with sign-in, why guests must never be identified, and how a webhook that skips TRANSFER events leaves the server wrong. 30 November 2026 · 7 min · RevenueCat / Subscriptions / Backend
  6. 07 Showing fullscreen ads in React Native: why timers lie on Android and what to wait for instead JavaScript timers pause on Android while a fullscreen ad is on screen, so every timeout cap fires late and in a burst. The ad lifecycle events to trust, a stage lock for iOS, an opened-guard around show(), and the rewarded-ad grace period. 30 November 2026 · 5 min · React Native / Ads / Android

All 12 notes, grouped by topic