fix: improve loading state handling in RootLayout component - #155
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 49 minutes and 59 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. 📝 WalkthroughWalkthroughThis PR introduces server health monitoring with outage/update screens, integrates RevenueCat subscription checkout with multi-tier plans, refactors chat message list scrolling behavior, migrates cryptographic backends to Changes
Sequence DiagramssequenceDiagram
participant Client as React Native App
participant AppContent as AppContent (Root)
participant Server as Health Check Server
participant Crypto as Crypto Init
participant Cache as Cache/Store
Client->>AppContent: Mount RootLayout
AppContent->>Server: Poll SERVER_URL (every 5s)
alt Server Down
Server-->>AppContent: HTTP Error / No Response
AppContent->>Client: Render OutageScreen
else Server Updating
Server-->>AppContent: Response starts with "update"
AppContent->>Client: Render UpdateScreen (with duration)
else Server OK
Server-->>AppContent: 200 OK
AppContent->>AppContent: Set serverStatus = "ok"
AppContent->>Crypto: initCrypto(SERVER_URL, token)
AppContent->>Cache: useCacheFetch(/chat/rooms)
Cache-->>AppContent: Cached chat rooms
AppContent->>Client: Render AppContent → Slot
end
sequenceDiagram
participant User as User
participant App as Checkout Screen
participant RevenueCat as RevenueCat Offerings
participant Purchases as Purchases SDK
participant Success as Purchase Result
User->>App: Navigate with planId & billing
App->>RevenueCat: Purchases.getOfferings()
RevenueCat-->>App: Available packages (annual/monthly)
App->>App: Select package (with fallback logic)
App->>User: Render order summary & features
User->>App: Tap "Subscribe" button
App->>Purchases: Purchases.purchasePackage(pkg)
Purchases-->>Success: Purchase complete
Success-->>App: customerInfo.entitlements.active[planId]
App->>App: Update loading state
App->>User: Success notification
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
… loading state handling
… key generation methods
…f with WebBrowser links in SettingsScreen
… new plans structure
closes #48 by @GRuoss
Summary by CodeRabbit
New Features
Improvements