Skip to content

feat(kit): automate ASC review submissions#246

Merged
hyochan merged 9 commits into
mainfrom
feat/kit-asc-review-submissions
Jul 23, 2026
Merged

feat(kit): automate ASC review submissions#246
hyochan merged 9 commits into
mainfrom
feat/kit-asc-review-submissions

Conversation

@hyochan

@hyochan hyochan commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

  • add a secure project-level App Review screenshot slot for IAPKit-managed Apple products
  • prepare current IAP/subscription review versions and submit eligible batches through App Store Connect's version-based review workflow
  • surface first-product, new-group, active-draft, and ambiguous-network cases as durable manual actions instead of unsafe retries

Changes

Secure screenshot storage

  • accepts flattened PNG or JPEG files up to 10 MB
  • verifies extension, MIME type, magic bytes, dimensions, alpha/transparency, and a full Sharp decode before persistence
  • keeps the blob private and limits configuration/download/removal to organization admins and owners
  • safely replaces prior files and reclaims failed, expired, pruned, and project-cascade storage

App Store Connect review workflow

  • supports current IAP and subscription review versions and en-US version localizations
  • reserves both IAP and subscription screenshot resources, honors every uploadOperation range/header/method, commits the MD5 checksum, and polls delivery
  • resumes checksum-committed processing assets without destructive re-upload
  • creates bounded review submissions without adopting unidentified or user-created drafts
  • prechecks first-of-type and subscription-group history with lazy, cached, short-circuit lookups
  • leaves every manual or failed row Draft so a crash cannot lose the operator instruction
  • persists the handled screenshot file identity so Ready rows resume exactly once per replacement image across pull-syncs and bounded jobs

Job and dashboard behavior

  • checks cancellation/deadlines at phase, chunk, request, upload-operation, and delivery-poll boundaries
  • cancels IAPKit-owned drafts on abort and stops remote work with a cleanup safety window
  • preserves statusless submission ambiguity as a manual inspection result
  • keeps manual results visible across reloads and labels all dry-run counts as prospective with no writes performed
  • documents the project-level screenshot reuse policy, manual app-version requirements, and retry model

Preview

Local IAPKit ASC review submission documentation

Test plan

  • Kit TypeScript and Convex typechecks
  • Kit ESLint and Prettier checks
  • Kit full suite: 66 files / 788 tests
  • Martie workflow server smoke: compiled server + health/static/API/verify probes (no live sandbox purchase)
  • Kit production and compiled-server builds
  • Docs lint, typecheck, and production build
  • bun audit:docs
  • bun audit:parity
  • bun audit:release-state
  • git diff --check
  • independent contract/resilience review with no remaining blocker

Closes #242

Summary by CodeRabbit

  • New Features
    • Added project-level iOS “App Review screenshot” upload, replacement, download, and removal.
    • Product sync now supports an eligibility-driven, version-based App Review workflow (including review screenshot reuse/resume).
    • Sync result banners now surface manual actions, planned writes, failure details, and truncation indicators.
  • Bug Fixes
    • Strengthened server-side screenshot validation (strict MIME/extension matching, corruption detection, PNG alpha/transparency rejection, size enforcement).
    • Improved product sync cancellation handling with finer-grained checkpointing and bounded cleanup.
  • Documentation
    • Clarified App Review behavior, manual action reporting, cancellation checkpoints, and screenshot lifecycle/reuse.

hyochan added 3 commits July 23, 2026 02:28
Add a private project-level PNG/JPEG review screenshot slot with full server-side decoding, replacement, pruning, and cascade cleanup.\n\nPrepare current IAP and subscription review versions, honor multipart ASC asset uploads, and submit bounded eligible batches with exact first-product/group manual fallbacks. Preserve resumability across cancellation, deadlines, ambiguous responses, and multi-run Ready rows while keeping dry-run and dashboard results truthful.
Document the secure project-level screenshot reuse policy, version-based submission steps, dry-run behavior, first-product and group manual actions, ambiguous network fallback, and bounded cancellation semantics.
Add the compressed local IAPKit documentation preview fallback for the pull request attachment.
@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.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@hyochan, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 47ac976a-29d2-42f4-9925-e35034e30e45

📥 Commits

Reviewing files that changed from the base of the PR and between f644e12 and 495105d.

📒 Files selected for processing (2)
  • packages/kit/convex/files/validation.test.ts
  • packages/kit/convex/files/validation.ts
📝 Walkthrough

Walkthrough

Adds project-level Apple App Review screenshot validation and management, a version-based App Store Connect review submission workflow, finer-grained product-sync cancellation, bounded sync results with manual actions, updated result UI, tests, and documentation.

Changes

Apple App Review screenshot storage and validation

Layer / File(s) Summary
Screenshot storage and validation
packages/kit/convex/files/*, packages/kit/convex/schema.ts, packages/kit/convex/projects/*
Adds screenshot-specific validation, authorization, reservation tracking, storage cleanup, project lookup, replacement behavior, and Convex runtime support for sharp.
Screenshot settings UI
packages/kit/src/pages/auth/organization/project/settings.tsx, packages/kit/src/pages/auth/organization/project/settings.test.tsx
Adds client-side validation, upload/remove controls, project-level screenshot state, server validation, and related UI tests.

ASC review-version workflow

Layer / File(s) Summary
ASC review-version engine
packages/kit/convex/products/ascReview.ts, packages/kit/convex/products/asc.ts, packages/kit/convex/products/ascReview.test.ts, packages/kit/convex/products/asc.test.ts
Adds eligibility checks, version inspection and reuse, localization updates, screenshot upload/resume behavior, submission retries, manual-gate classification, and cancellation-aware ASC requests.
Sync worker integration
packages/kit/convex/products/sync.ts, packages/kit/convex/products/jobs.ts, packages/kit/convex/products/syncResult.ts, packages/kit/convex/utils/concurrency.ts, related tests
Threads screenshot identity and review metadata through iOS sync, adds deadline/cancellation handling, stops concurrent work after failure, and bounds persisted manual actions and planned writes.
Sync results and documentation
packages/kit/src/pages/auth/organization/project/products.tsx, packages/kit/src/pages/auth/organization/project/product-sync-result.ts, packages/kit/src/pages/docs/sections/products.tsx, packages/docs/src/pages/docs/kit-backend.tsx
Adds shared result formatting, manual-action and truncation display, updated toast/banner behavior, and documentation for review submission and cancellation.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • hyodotdev/openiap#127 — Extends the product-sync job lifecycle with cancellation, deadlines, and bounded results.
  • hyodotdev/openiap#128 — Overlaps with product-sync completion toast and result presentation changes.

Suggested labels: kit, :rabbit2: server, 🧪 test

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 23.53% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: automating ASC review submissions.
Linked Issues check ✅ Passed The PR adds the screenshot slot, validation/UI, and ASC reserve/upload/checksum/submit flow required by #242.
Out of Scope Changes check ✅ Passed The extra sync-result, deadline, and cancellation updates support the review-submission workflow rather than introducing unrelated scope.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/kit-asc-review-submissions

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 added 🏟️ ui 🍵 integration openiap-kit packages/kit (IAPKit SaaS) 🎯 feature New feature 📖 documentation Improvements or additions to documentation 📱 iOS Related to iOS labels Jul 22, 2026
@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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/kit/src/pages/auth/organization/project/products.tsx`:
- Around line 1155-1182: Update the result banner near the existing failures
count to render each persisted entry in job.result.failures, including its
product identifier and failure reason using the established list styling
pattern. Keep the current failure count and failuresTruncated notice intact, and
conditionally omit the list when there are no failures.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3acf5059-9d48-4bb6-8a56-2a235f387e1a

📥 Commits

Reviewing files that changed from the base of the PR and between dc17c54 and 9f7a770.

⛔ Files ignored due to path filters (1)
  • .github/pr-previews/iapkit-asc-review-submission.jpg is excluded by !**/*.jpg
📒 Files selected for processing (30)
  • packages/docs/src/pages/docs/kit-backend.tsx
  • packages/kit/convex.json
  • packages/kit/convex/files/action.ts
  • packages/kit/convex/files/internal.ts
  • packages/kit/convex/files/mutation.ts
  • packages/kit/convex/files/query.ts
  • packages/kit/convex/files/review-screenshot.test.ts
  • packages/kit/convex/files/validation.test.ts
  • packages/kit/convex/files/validation.ts
  • packages/kit/convex/products/asc.test.ts
  • packages/kit/convex/products/asc.ts
  • packages/kit/convex/products/ascReview.test.ts
  • packages/kit/convex/products/ascReview.ts
  • packages/kit/convex/products/jobs.test.ts
  • packages/kit/convex/products/jobs.ts
  • packages/kit/convex/products/sync.test.ts
  • packages/kit/convex/products/sync.ts
  • packages/kit/convex/products/syncResult.ts
  • packages/kit/convex/projects/helpers.test.ts
  • packages/kit/convex/projects/project-child-pending-deletion.test.ts
  • packages/kit/convex/schema.ts
  • packages/kit/convex/utils/concurrency.test.ts
  • packages/kit/convex/utils/concurrency.ts
  • packages/kit/server/api/v1/products.ts
  • packages/kit/src/pages/auth/organization/project/product-sync-result.test.ts
  • packages/kit/src/pages/auth/organization/project/product-sync-result.ts
  • packages/kit/src/pages/auth/organization/project/products.tsx
  • packages/kit/src/pages/auth/organization/project/settings.test.tsx
  • packages/kit/src/pages/auth/organization/project/settings.tsx
  • packages/kit/src/pages/docs/sections/products.tsx

Comment thread packages/kit/src/pages/auth/organization/project/products.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds end-to-end automation for Apple App Review submissions in IAPKit (Kit), including a secure project-level screenshot slot, server-side validation + lifecycle cleanup, and ASC version-based submission orchestration. This extends the existing iOS push-sync pipeline so eligible Draft/Ready rows can progress from metadata → screenshot upload → review submission, while safely surfacing non-retryable/ambiguous cases as durable manual actions.

Changes:

  • Introduces a private, admin/owner-managed “App Review screenshot” upload slot (PNG/JPEG, ≤10MB) with strict client/server validation and reliable blob reclamation.
  • Implements ASC “version-based review” workflow helpers (reserve screenshot, multipart upload ops, checksum commit, delivery polling, bounded submission batches, manual-action classification).
  • Improves job UX semantics (persisted manual actions, clearer sync summaries, terminal result visibility across reloads, tighter cancellation/deadline checks).

Reviewed changes

Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/kit/src/pages/docs/sections/products.tsx Documents ASC review submission behavior, screenshot slot policy, and manual-action outcomes.
packages/kit/src/pages/auth/organization/project/settings.tsx Adds UI + client-side pre-validation for uploading/removing the project App Review screenshot.
packages/kit/src/pages/auth/organization/project/settings.test.tsx Extends settings tests to cover screenshot validation, upload flow ordering, and error surfacing.
packages/kit/src/pages/auth/organization/project/products.tsx Updates sync toasts/result banner behavior and surfaces manual actions and persisted failures.
packages/kit/src/pages/auth/organization/project/product-sync-result.ts Adds helpers for consistent sync summaries and result-visibility rules across reloads.
packages/kit/src/pages/auth/organization/project/product-sync-result.test.ts Tests the new sync summary and result-visibility helper behavior.
packages/kit/src/pages/auth/organization/project/product-sync-failure-list.tsx Adds a UI component to render persisted per-product failures for completed jobs.
packages/kit/src/pages/auth/organization/project/product-sync-failure-list.test.tsx Tests persisted failure list rendering/omission behavior.
packages/kit/server/api/v1/products.ts Updates cancel endpoint documentation to reflect finer-grained cancellation checks.
packages/kit/convex/utils/concurrency.ts Enhances bounded concurrency mapper to stop scheduling new work after a failure.
packages/kit/convex/utils/concurrency.test.ts Adds coverage asserting failure stops new work while allowing in-flight cleanup.
packages/kit/convex/schema.ts Adds new file purpose + reservation validation markers and new job result fields (manualActions).
packages/kit/convex/projects/project-child-pending-deletion.test.ts Ensures abandoned validated/claimed screenshot blobs are reclaimed by reservation pruning.
packages/kit/convex/projects/helpers.test.ts Ensures project deletion reclaims screenshot storage alongside other project files.
packages/kit/convex/products/syncResult.ts Introduces caps + truncation helpers and deadline safety window logic for jobs/results.
packages/kit/convex/products/sync.ts Tracks handled screenshot identity and allows Ready-row resumption when screenshot changes.
packages/kit/convex/products/sync.test.ts Tests Ready-row resumption logic and persistence of handled screenshot identity.
packages/kit/convex/products/jobs.ts Wires truncation + manual actions into job persistence; strengthens cancellation semantics.
packages/kit/convex/products/jobs.test.ts Adds tests for truncation, deadline safety, and deadline persistence in job rows.
packages/kit/convex/products/ascReview.ts New ASC helpers for screenshot upload ops, delivery polling, version planning, and submission workflow.
packages/kit/convex/products/asc.ts Integrates review screenshot + version-based submission into the iOS push-sync pipeline.
packages/kit/convex/products/asc.test.ts Adds tests for eligibility loader laziness/caching and review disposition/product-type mapping.
packages/kit/convex/files/validation.ts Adds strict validation rules for the new screenshot file purpose and server-side content checks.
packages/kit/convex/files/validation.test.ts Adds coverage for screenshot metadata/content validation rules.
packages/kit/convex/files/review-screenshot.test.ts Adds comprehensive tests for screenshot private storage, validation, replacement, and internal reads.
packages/kit/convex/files/query.ts Includes the new screenshot purpose in list/count queries.
packages/kit/convex/files/mutation.ts Enforces screenshot slot semantics (internal-only, role restrictions, validated-blob requirement) and adds internal mutations for validation state.
packages/kit/convex/files/internal.ts Adds internal queries for validation inputs + private screenshot lookup and expands reservation pruning for claimed blobs.
packages/kit/convex/files/action.ts Adds Sharp-based decode validation and a Node action to validate uploaded screenshot blobs before persistence.
packages/kit/convex.json Allows Sharp as an external Node package for Convex actions.
packages/docs/src/pages/docs/kit-backend.tsx Updates public docs to describe screenshot-gated review submission and manualActions semantics.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/kit/convex/utils/concurrency.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.

Comment thread packages/kit/src/pages/auth/organization/project/products.tsx

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 33 changed files in this pull request and generated 1 comment.

Comment thread packages/kit/convex/files/action.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 35 changed files in this pull request and generated 1 comment.

Comment thread packages/kit/convex/products/jobs.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 35 changed files in this pull request and generated 1 comment.

Comment thread packages/kit/convex/files/validation.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 33 out of 35 changed files in this pull request and generated no new comments.

@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyodotdev hyodotdev deleted a comment from coderabbitai Bot Jul 22, 2026
@hyochan
hyochan merged commit ff7177a into main Jul 23, 2026
15 checks passed
@hyochan
hyochan deleted the feat/kit-asc-review-submissions branch July 23, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📖 documentation Improvements or additions to documentation 🎯 feature New feature 📱 iOS Related to iOS openiap-kit packages/kit (IAPKit SaaS) 🏟️ ui 🍵 integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kit: ASC App Review screenshot upload slot + automated inAppPurchaseSubmissions (review-submit)

2 participants