<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Anh Tran, dev notes</title>
    <link>https://theanh-dev.pages.dev/</link>
    <description>Long-form notes from a working mobile and full-stack developer: the bugs I hit in production apps, the fix, and how it was checked.</description>
    <language>en</language>
    <atom:link href="https://theanh-dev.pages.dev/rss.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Hybrid search on Postgres with pgvector: the Prisma migration that dropped the HNSW index and nobody got an error</title>
      <link>https://theanh-dev.pages.dev/articles/rag-pgvector-hybrid-search-prisma-index-drift/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/rag-pgvector-hybrid-search-prisma-index-drift/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>Why returning from a browser or the share sheet shows an app-open ad: marking external hand-offs in Flutter</title>
      <link>https://theanh-dev.pages.dev/articles/welcome-back-app-open-ad-external-handoff-flutter/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/welcome-back-app-open-ad-external-handoff-flutter/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>Long-term memory for an LLM chat backend without losing the prompt cache: fold in blocks, claim before you write</title>
      <link>https://theanh-dev.pages.dev/articles/llm-chat-memory-prompt-cache-window-folding/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/llm-chat-memory-prompt-cache-window-folding/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>Maestro on a real Android phone: fast flows, rapid-tap tests and counting crashes instead of trusting green</title>
      <link>https://theanh-dev.pages.dev/articles/maestro-rapid-tap-flows-on-real-android/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/maestro-rapid-tap-flows-on-real-android/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>RevenueCat in an app with accounts: restore behavior, guests and the Pro subscription two users shared</title>
      <link>https://theanh-dev.pages.dev/articles/revenuecat-restore-behavior-account-bound-subscriptions/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/revenuecat-restore-behavior-account-bound-subscriptions/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>Showing fullscreen ads in React Native: why timers lie on Android and what to wait for instead</title>
      <link>https://theanh-dev.pages.dev/articles/react-native-fullscreen-ads-timers-stop-android/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/react-native-fullscreen-ads-timers-stop-android/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>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.</description>
    </item>
    <item>
      <title>Measuring ad show rate per placement in GA4: four events, one gate per trigger and a denominator trap</title>
      <link>https://theanh-dev.pages.dev/articles/ga4-ad-show-rate-events-per-placement/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/ga4-ad-show-rate-events-per-placement/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>How to get a per-unit show rate (impressions divided by fills) out of Firebase Analytics for Flutter and React Native apps. The event contract, why GA4 cannot backfill custom dimensions, and the (not set) bug that made a rate read 100%.</description>
    </item>
    <item>
      <title>Adding five ad networks to AdMob mediation in Flutter: the Maven repo, the Unity SDK pin and the 28 new activities</title>
      <link>https://theanh-dev.pages.dev/articles/flutter-admob-mediation-five-networks-pitfalls/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/flutter-admob-mediation-five-networks-pitfalls/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>A checklist from wiring Liftoff, Meta, Mintegral, AppLovin and Unity adapters into a Flutter app: the repository Gradle cannot find, a Unity SDK that does not match its adapter, SKAdNetwork ids, consent, and the manifest check you need afterwards.</description>
    </item>
    <item>
      <title>Android SDK activities that crash on a bare intent: an AppComponentFactory guard and a manifest gate</title>
      <link>https://theanh-dev.pages.dev/articles/android-stray-intent-sdk-activity-crash-guard/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/android-stray-intent-sdk-activity-crash-guard/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>A pre-launch test robot opens every activity in the merged manifest with an empty intent, and Play Billing's ProxyBillingActivity throws before any of your code runs. How to reproduce it, guard it narrowly and stop a new SDK from reintroducing it.</description>
    </item>
    <item>
      <title>When the client writes the date: guarding a Supabase streak table with a BEFORE trigger</title>
      <link>https://theanh-dev.pages.dev/articles/trusting-client-dates-supabase-streak-trigger/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/trusting-client-dates-supabase-streak-trigger/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>Row-level security only checks who owns a row, not what they put in it. How a daily check-in table let users pick their own streak and day, and how a BEFORE trigger recomputed both on the server without breaking users in UTC+7.</description>
    </item>
    <item>
      <title>Supabase RPC rewards that clients can forge: dedup keys, premium flags and a function that listed no one as Pro</title>
      <link>https://theanh-dev.pages.dev/articles/supabase-rpc-forged-rewards-client-supplied-keys/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/supabase-rpc-forged-rewards-client-supplied-keys/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>How check-in and quest reward functions let a signed-in user mint unlimited in-app currency, why the server could not be trusted to spot paying users, and the rule that fixed both: the server builds every key and reads every entitlement itself.</description>
    </item>
    <item>
      <title>A RevenueCat webhook handler for Supabase that does not lose a paid purchase</title>
      <link>https://theanh-dev.pages.dev/articles/revenuecat-webhook-supabase-edge-function/</link>
      <guid isPermaLink="true">https://theanh-dev.pages.dev/articles/revenuecat-webhook-supabase-edge-function/</guid>
      <pubDate>Mon, 30 Nov 2026 08:00:00 GMT</pubDate>
      <author>theanhybdz2k4@gmail.com (Trần Thế Anh)</author>
      <description>Failing closed on a missing secret, logging every event before acting on it, handling TRANSFER and refunds, and why a 200 for a rejected gem pack is a bug. Notes from a production Edge Function.</description>
    </item>
  </channel>
</rss>
