feat(kilo-pass): add Google Play purchase verifier - #5586
Open
iscekic wants to merge 8 commits into
Open
Conversation
This was referenced Aug 27, 2026
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit 4d253e8)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4d253e8)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit 21e05a1)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Reviewed by grok-4.6 · Input: 60K · Output: 4.9K · Cached: 149.9K Review guidance: REVIEW.md from base branch |
This was referenced Aug 27, 2026
pandemicsyn
approved these changes
Aug 27, 2026
The verifier decoded subscriptionState but never checked it, so an on-hold, paused or pending purchase with a future expiry completed as active. Allow only active, canceled-but-unexpired and grace-period states.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
No new behavior — the level adds an internal purchase verification step that no customer-facing path uses yet.
Reviewer Notes
verifyGooglePlayKiloPassPurchaseis a new entry point that fetches a Google Play subscriptions v2 payload for a purchase token and maps it ontoValidatedStoreKiloPassPurchaseunder the Google Play payment provider. The mapper now rejects a decoded purchase whosestartTimeMsorexpiryTimeMsis non-finite, so a pending subscription that omits its start time throws a domain error instead of failing later on an invalidDate. The mapping also rejects missing identifiers, expired purchases, and products outside the enabled mobile store catalog, so completion fails before the purchase ledger runs; expired purchases are rejected on this path only because renewals and refunds arrive through the notifications handler.Files
apps/web/src/lib/kilo-pass/google-play-verifier.ts— addsverifyGooglePlayKiloPassPurchase,decodeGooglePlaySubscriptionPurchase, andmapGooglePlayKiloPassPurchaseplus theGooglePlayEnvironmentandGooglePlayDecodedPurchasetypes; the mapper rejects non-finite timestamps before the expiry check, anddecodeGooglePlaySubscriptionPurchasefalls back to the top-levellatestOrderIdand keeps the raw payload.Test: 1 test file added —
apps/web/src/lib/kilo-pass/google-play-verifier.test.ts, 197 lines.Generated: none.
Verification
E2E report: none — a lower PR names its own change alone; the tip PR carries the E2E report. No manual test paths were run for this level.
Visual Changes
Visual Changes: N/A
Human steps: none known.
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 #5581android-iap-e895-s2— feat(kilo-pass): add Google Play publisher SDK #5582android-iap-e895-s3— feat(kilo-pass): add Google Play purchase verifier #5586 ← this PRandroid-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)