feat(commerce): add Play Kilo Pass presentation flag - #5581
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (5 files)
Previous Review Summary (commit fe6bb56)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit fe6bb56)Status: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
Files Reviewed (4 files)
Reviewed by grok-4.6 · Input: 164.3K · Output: 7.7K · Cached: 86.5K Review guidance: REVIEW.md from base branch |
| storefront: PurchaseStorefront | null | undefined; | ||
| product: PurchaseProduct; | ||
| program?: string | null; | ||
| supportsNativePlayKiloPass?: boolean; |
There was a problem hiding this comment.
bot: The new capability flag cannot reach the existing tRPC purchase flows.
Suggested fix: Add supportsNativePlayKiloPass: z.boolean().optional() to the request schema(s) intended to support Android native IAP—at least GetPurchasePresentationInputSchema, and PreflightPurchaseInputSchema if that is the client purchase gate—then forward input.supportsNativePlayKiloPass when constructing each PurchasePresentationInput. Add router tests showing true produces the enabled Android presentation/preflight behavior and omission remains legacy behavior. As written, both schemas strip/reject the field and the router reconstructs inputs without it, so RPC callers always resolve Android Play Kilo Pass as unavailable or Stripe web management.
Summary
No new behavior — this change only prepares the Google Play purchase path for Kilo Pass on Android; a later change turns it on. Every user keeps the purchase options they see today.
The
ResolvePurchasePresentationInputcontract gains an optionalsupportsNativePlayKiloPassfield. A caller that sends true for an Android Play Kilo Pass now receivesnative_iap, andisNativeIapMutationAllowedreturns true for the same combination. Old Android callers omit the field or send false and keep the current unavailable or Stripe web-management result, so no stored input breaks.Files
packages/app-shared/src/commerce/purchase-presentation.ts— addssupportsNativePlayKiloPasstoResolvePurchasePresentationInput; adds a native_iap branch for Android Play Kilo Pass when the flag is true; extendsisNativeIapMutationAllowedto admit Android Play Kilo Pass.The web
PurchasePresentationInputgains the same optional field, andbuildPurchasePresentationforwards it to the shared resolver. A future Android client that calls the web path can signal native Play IAP support without changing the web return shape. Current web callers are unchanged because the field is optional and unset.Files
apps/web/src/lib/kilo-pass/purchase-presentation.ts— addssupportsNativePlayKiloPasstoPurchasePresentationInputand passes it through inbuildPurchasePresentation.Tests: 2 test files updated.
Generated: none.
Verification
E2E: bot-e2e — runtime verification runs once on the tip PR (level 6) after all levels land. This level is reviewed on its own diff.
Visual Changes
Visual Changes: N/A
Reviewer Notes
Level 1 changes no runtime behavior on its own; the flag is inert until level 6 wires the Android client to send true.
Stacked PRs — merge bottom to top. Each level shows only its own diff.
Runtime verification (E2E, user advocacy, simplify) runs on the tip PR over every level.
Every level keeps its own checks, its own bot review, and its own threads; each one is answered on its own PR.
Each level is its own deliverable: it builds and passes its own checks alone.
A finding on a level is repaired on that level, then carried upward with stack.sh forward.
android-iap-e895— feat(commerce): add Play Kilo Pass presentation flag #5581 ← this PRandroid-iap-e895-s2— feat(kilo-pass): add Google Play publisher SDK #5582android-iap-e895-s3— feat(kilo-pass): add Google Play purchase verifier #5586android-iap-e895-s4— feat(kilo-pass): handle Play real-time notifications #5598android-iap-e895-s5— feat(kilo-pass): add completePlayPurchase mutation #5608android-iap-e895-s6— feat(mobile): offer Google Play Kilo Pass purchase #5618 (tip)