Skip to content

feat(cmp-paycraft): v2.0.3 — auto-fetch + placeholder config - #89

Merged
therajanmaurya merged 1 commit into
developmentfrom
fix/cmp-paycraft-2.0.3-cloud-fetch
Jun 18, 2026
Merged

feat(cmp-paycraft): v2.0.3 — auto-fetch + placeholder config#89
therajanmaurya merged 1 commit into
developmentfrom
fix/cmp-paycraft-2.0.3-cloud-fetch

Conversation

@therajanmaurya

Copy link
Copy Markdown
Collaborator

Summary

v2.0.3 closes three v2 SDK init blockers discovered during reels-downloader integration on Android (CPH2423):

  1. Placeholder config in initialize() — Cloud/SelfHosted now populate PayCraft.config synchronously so requireConfig() never throws between init and the first SuiteConfig arrival (closes PayCraftBanner.kt:138 crash class).

  2. Auto-fetch SuiteConfig on initfetchAndApplySuiteConfig() runs in a background scope at the tail of initialize(). The SDK had ConfigClient.fetch() infrastructure but nothing called it from production paths — paywall stayed in loading state forever.

  3. Koin DI race fixPayCraftModule reads PayCraft.backend + PayCraft.apiKey (both synchronous) instead of requireConfig().apiKey (depends on async fetch). Already in 2.0.2; preserved here.

Plus: infra/deploy/deploy.sh Phase 3.5 FUNCTIONS DEPLOY — wires up Edge Function deploys via framework-supabase-access-token from the vault.

Verification

  • ✅ App launches on Android device (CPH2423)
  • ✅ PayCraft logs Backend=cloud, then [loadConfig] GET …/functions/v1/config
  • ✅ Koin starts cleanly (130 definitions in <3ms)
  • ✅ BillingManager [init] completes without errors
  • ✅ Paywall renders loading spinner (placeholder empty plans) instead of crashing
  • 🚧 Cloud fetch returns 404 — config Edge Function not deployed (separate task: Phase 3.5)

🤖 Generated with Claude Code

… placeholder config

Three related fixes for the v2 Cloud SDK initialization path:

1. Placeholder config in initialize() — Cloud/SelfHosted backends now populate
   PayCraft.config synchronously with an empty-list PayCraftConfig before
   kicking off the async cloud fetch. This means requireConfig() callers
   (PayCraftBanner.kt:138, PaywallScreen consumers, etc.) never throw
   IllegalStateException between init and the first SuiteConfig arrival.

2. Auto-fetch SuiteConfig on init — fetchAndApplySuiteConfig() runs in
   sdkScope at the tail of initialize() for non-Mock backends. Issues
   GET $backend.configUrl?apiKey=…, decodes the SuiteConfig response,
   and publishes via applySuiteConfig(). On HTTP non-success / network
   failure, logs and leaves the placeholder in place so UI shows empty
   state instead of crashing.

3. Koin DI race fix — PayCraftModule's SupabaseClient singleton now reads
   PayCraft.backend (statically known for Cloud) and PayCraft.apiKey (set
   synchronously by initialize()) instead of going through requireConfig()
   which depends on the async fetch.

Plus: deploy.sh Phase 3.5 FUNCTIONS DEPLOY — wires up the Edge Function
deploy step using framework-supabase-access-token from the vault.

Verified on Android (CPH2423): app launches, PayCraft logs initialize +
GET to /functions/v1/config, no Koin or requireConfig crashes,
BillingManager initializes cleanly.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying paycraft-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3c4ab28
Status:⚡️  Build in progress...

View logs

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pay-craft Ready Ready Preview, Comment Jun 18, 2026 5:06pm

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@therajanmaurya, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 5 minutes and 12 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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 credits.

🚦 How do rate limits work?

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

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4c2d8c30-b7ae-4615-99a3-df3e01f4a141

📥 Commits

Reviewing files that changed from the base of the PR and between b2581a6 and 3c4ab28.

📒 Files selected for processing (3)
  • cmp-paycraft/src/commonMain/kotlin/com/mobilebytelabs/paycraft/PayCraft.kt
  • gradle.properties
  • infra/deploy/deploy.sh
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cmp-paycraft-2.0.3-cloud-fetch

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 and usage tips.

@therajanmaurya
therajanmaurya merged commit 5f497ef into development Jun 18, 2026
6 of 10 checks passed
@therajanmaurya
therajanmaurya deleted the fix/cmp-paycraft-2.0.3-cloud-fetch branch July 29, 2026 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants