chore(repo): fixed dogfooding google login#1269
Conversation
|
Warning Review limit reached
Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds an ChangesEnvironment-gated login flow
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant LoginScreen
participant GoogleSignIn
participant FirebaseAuth
participant UserAuthRepository
User->>LoginScreen: Tap Google login (Pronto only)
alt Web platform
LoginScreen->>FirebaseAuth: signInWithPopup
FirebaseAuth-->>LoginScreen: auth result
else Non-web platform
LoginScreen->>GoogleSignIn: authenticate()
GoogleSignIn-->>LoginScreen: authenticationEvents
end
LoginScreen->>LoginScreen: _completeGoogleLogin(event)
LoginScreen->>UserAuthRepository: login()
UserAuthRepository->>UserAuthRepository: videoClient.connect()
alt Failure
UserAuthRepository->>UserAuthRepository: videoClient.disconnect()
UserAuthRepository-->>LoginScreen: throw error
LoginScreen->>LoginScreen: _showSnackBar(error)
else Success
UserAuthRepository-->>LoginScreen: UserCredentials
LoginScreen-->>User: Navigate to home
end
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1269 +/- ##
==========================================
+ Coverage 10.16% 10.24% +0.08%
==========================================
Files 679 679
Lines 49765 49765
==========================================
+ Hits 5059 5100 +41
+ Misses 44706 44665 -41 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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 `@dogfooding/lib/screens/login_screen.dart`:
- Around line 107-119: The nullable email handling in _completeGoogleLogin is
unsafe because email is force-unwrapped even though both Google sign-in call
sites can pass null. Update _completeGoogleLogin to guard against a missing
email before calling createValidId, and ensure the Google auth flow handles that
failure gracefully instead of relying on email!; also make sure
_handleGoogleAuthEvent and the Firebase/native callers surface an error or skip
login cleanly when the email is absent.
- Around line 71-105: The Google sign-in flow in _loginWithGoogle and
_loginWithGoogleWeb currently only logs failures, so users get no feedback when
authenticate() or signInWithPopup() fails. Update the error handling in both
paths to call _showSnackBar with a clear failure message (alongside or instead
of debugPrint), and make sure the native GoogleSignIn and web FirebaseAuth
branches both surface popup, network, or domain-restriction errors to the user.
- Around line 37-55: Guard the Google Sign-In startup in _initGoogleSignIn()
because locator.getAsync<GoogleSignIn>() can throw and the unawaited call from
initState() would otherwise surface as an unhandled async error. Wrap the async
lookup and subscription setup in try/catch, return early on failure, and check
mounted before assigning _googleAuthSubscription so a late completion after
dispose() does not leave an uncancelled listener.
🪄 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: b2d006ff-2ddd-48b4-aa55-71a547b57edd
📒 Files selected for processing (6)
dogfooding/lib/core/model/environment.dartdogfooding/lib/core/repos/user_auth_repository.dartdogfooding/lib/di/injector.dartdogfooding/lib/screens/login_screen.dartdogfooding/lib/widgets/environment_switcher.dartdogfooding/web/index.html
💤 Files with no reviewable changes (1)
- dogfooding/web/index.html
Dogfooding login fixes:
admintouserSummary by CodeRabbit
New Features
Bug Fixes
Chores