empty api key safety; refactoring and more misc cleanup#70
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 45 minutes and 6 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE 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 |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3d17e48. Configure here.
|
|
||
| val status: HeliumPaywallTransactionStatus = when (statusString.lowercase()) { | ||
| "completed", "purchased" -> HeliumPaywallTransactionStatus.Purchased | ||
| "purchased" -> HeliumPaywallTransactionStatus.Purchased |
There was a problem hiding this comment.
Removed "completed" mapping breaks DemoHeliumCallbacks purchase flow
High Severity
The "completed" status string was removed from the native handlePurchaseResult mapping on both Android and iOS, but DemoHeliumCallbacks.makePurchase in src/purchase-handlers.ts still returns { status: 'completed' as HeliumTransactionStatus }. Any code using this exported demo class (or any custom handler returning "completed") will now have successful purchases incorrectly treated as Failed on the native side, since "completed" falls through to the else/default branch.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 3d17e48. Configure here.


Note
Medium Risk
Moderate risk because it changes initialization gating and event/purchase status handling across JS, Android, and iOS, which could affect whether the SDK initializes or whether queued events/purchase results are processed as before.
Overview
Adds defensive initialization across JS, Android, and iOS:
initializenow aborts (with logging) whenapiKeyis missing/empty, avoiding partial setup.Adjusts bridge reliability behavior by making JS listener cleanup resilient to emitter errors, and changing Android’s queued-event flush to drop events that fail to emit instead of re-queuing them.
Tightens purchase result parsing on both platforms by no longer treating
"completed"as a successful purchase status (only"purchased"maps to success).Reviewed by Cursor Bugbot for commit 962d285. Bugbot is set up for automated code reviews on this repo. Configure here.