Skip to content

fix(kit): map Play one-time product state - #268

Merged
hyochan merged 1 commit into
mainfrom
fix/kit-play-onetime-state
Aug 1, 2026
Merged

hyochan merged 1 commit into
mainfrom
fix/kit-play-onetime-state

Conversation

@hyochan

@hyochan hyochan commented Aug 1, 2026 •

Copy link
Copy Markdown
Member

Summary

  • map modern Google Play one-time purchase option states instead of marking every pulled product Active
  • preserve explicit IAPKit deletion intent while treating upstream removals as store-owned state
  • fail closed for missing or future Play states so a both sync cannot republish an unavailable product

Safety

  • any ACTIVE option keeps the product Active
  • INACTIVE and INACTIVE_PUBLISHED map to Removed
  • only an explicit all-DRAFT option set maps to Draft
  • store-reported Removed rows are excluded from the same sync job's delete pass
  • explicit kit-authored Removed rows remain eligible for the intended upstream delete

Test plan

  • SDK parity audit
  • Kit TypeScript and Convex typecheck
  • ESLint and Prettier
  • Kit test suite: 877 tests
  • Vite and compiled-server build
  • HTTP and browser smoke probes
  • independent two-round review

Preview

No recording is applicable because this changes server-side Play catalog state mapping. The unit tests cover the state matrix and the same-job removal selector behavior.

Summary by CodeRabbit

  • Bug Fixes
    • Google Play one-time products now accurately reflect their store-reported status, including draft, active, inactive, missing, and removed states.
    • Store-removed Android products are no longer queued for removal again.
    • Kit-authored removals remain preserved and eligible for synchronization.
  • Tests
    • Added coverage for Google Play product state mapping and Android product removal synchronization.

Honor modern Play purchase-option states during pull sync. Preserve explicit kit deletion intent while preventing upstream removals and unknown states from being repushed or deleted.
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@hyochan hyochan added kit IAPKit (receipt-validation SaaS) openiap-kit packages/kit (IAPKit SaaS) 🛠 bugfix All kinds of bug fixes 🤖 android Related to android labels Aug 1, 2026
@coderabbitai

coderabbitai Bot commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5d90a7d3-ae97-4e7a-8e18-5e3189887396

📥 Commits

Reviewing files that changed from the base of the PR and between d3491fb and 4e551a2.

📒 Files selected for processing (4)
  • packages/kit/convex/products/play.test.ts
  • packages/kit/convex/products/play.ts
  • packages/kit/convex/products/sync.test.ts
  • packages/kit/convex/products/sync.ts

📝 Walkthrough

Walkthrough

Modern Google Play one-time product imports now map purchase-option states to kit states. Android synchronization now records store-reported removals as store-originated and preserves kit-authored removal behavior. Tests cover both state mapping and removal processing.

Changes

Android product synchronization

Layer / File(s) Summary
Play purchase-option state mapping
packages/kit/convex/products/play.ts, packages/kit/convex/products/play.test.ts
mapModernPlayOneTimeState maps active, inactive, draft, missing, mixed, and unknown purchase-option states. Modern one-time imports use this mapping instead of always assigning Active.
Store removal provenance
packages/kit/convex/products/sync.ts, packages/kit/convex/products/sync.test.ts
Store-reported removals receive store provenance. Kit-authored removals retain kit provenance and remain available for push processing. Tests cover both cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: mapping Google Play one-time product states during synchronization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/kit-play-onetime-state

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@hyochan
hyochan merged commit 77f91d9 into main Aug 1, 2026
13 checks passed
@hyochan
hyochan deleted the fix/kit-play-onetime-state branch August 1, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 android Related to android 🛠 bugfix All kinds of bug fixes kit IAPKit (receipt-validation SaaS) openiap-kit packages/kit (IAPKit SaaS)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant