feat(cmp-paycraft): v2.0.3 — auto-fetch + placeholder config - #89
Conversation
… 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
v2.0.3 closes three v2 SDK init blockers discovered during reels-downloader integration on Android (CPH2423):
Placeholder config in
initialize()— Cloud/SelfHosted now populatePayCraft.configsynchronously sorequireConfig()never throws between init and the first SuiteConfig arrival (closesPayCraftBanner.kt:138crash class).Auto-fetch SuiteConfig on init —
fetchAndApplySuiteConfig()runs in a background scope at the tail ofinitialize(). The SDK hadConfigClient.fetch()infrastructure but nothing called it from production paths — paywall stayed in loading state forever.Koin DI race fix —
PayCraftModulereadsPayCraft.backend+PayCraft.apiKey(both synchronous) instead ofrequireConfig().apiKey(depends on async fetch). Already in 2.0.2; preserved here.Plus:
infra/deploy/deploy.shPhase 3.5 FUNCTIONS DEPLOY — wires up Edge Function deploys viaframework-supabase-access-tokenfrom the vault.Verification
Backend=cloud, then[loadConfig] GET …/functions/v1/config[init]completes without errorsconfigEdge Function not deployed (separate task: Phase 3.5)🤖 Generated with Claude Code