All packsPlay Billing MachinerySolve
google play subscription staleness guard stale notification overwrite
A slow retry of an old notification can still race a newer write
Re-reading state on every notification fixes ordering between two notifications, but a slow retry of a stale one can still race a fresher write without its own version guard (decision 5).
This is one of the things Play Billing Machinery already handles. Sell subscriptions in your Android app on the Billing Library version Google requires from 31 August 2026.
Is this you?
Re-querying the Play API on every notification makes an out-of-order pair of notifications converge on the current truth -- but it doesn't protect against a slow retry of an already-stale notification racing a write that happened after it was queued. Without a separate version check, that race can silently downgrade a live subscriber back to an older, wrong state.
Why this one is easy to get wrong
Re-reading from the source of truth feels like it should fully solve ordering by itself -- if you always ask Google what's true right now, how could a stale event still cause harm? The subtlety is that "right now" is evaluated at read time, and a retry's read can still land after a newer write has already been applied and moved on.
What you get instead
Every applied state carries a version marker -- SubscriptionPurchaseV2's own etag, with eventTimeMillis as the fallback ordering key -- and a fetch whose marker is older than what's already stored is dropped rather than written. A voidedPurchaseNotification is the one exception: it overrides every row in the entitlement truth table and revokes immediately, regardless of the staleness guard.
Source: ARCHITECTURE.md decision 5 — checkable in the pack you receive
How you actually use this
You don’t install a library or wire up an SDK. Your own coding agent builds the code in your project, and you keep it — no runtime dependency on us.
Step 1
Download and unzip
You get a folder: the docs that tell an agent what to build, a starting skeleton, and the test suite that decides when it's done.
Step 2
Open it in Claude Code or Cursor
Point your coding agent at the folder. Nothing to install, no account with us, no API key.
Step 3
Paste one prompt
The pack contains the exact prompt. Paste it as your first message and leave it alone — it works through the build itself, choosing a cheaper or stronger model per task.
Step 4
Run ./verify.sh
One command. It prints a pass or fail for every check. Green means the build is done — the same script we ran to produce the receipt on this page.
Typical build: about 33 minutes of your agent working, mostly unattended. Then you integrate the working module into your app the way you would any code you’d written yourself.
Why you can believe this
3 of 3 runs passedWe ran this pack from an empty folder 3 times and published exactly what happened — every check, the model, the token cost, the wall time. Not a testimonial, and not our opinion: the same verify.sh you run yourself. Read the full receipt →