fixed mobile login issue and created ci cd to send apk build over mail#22
fixed mobile login issue and created ci cd to send apk build over mail#22unstoppableayush merged 1 commit intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR aims to address mobile authentication UX (surfacing auth failures), add an automated CI workflow to build and email a release APK, and includes additional networking/UI/Android build adjustments.
Changes:
- Add
errorMessagehandling inAuthProviderand show SnackBars on login/register + Google sign-in failures. - Introduce a GitHub Actions workflow that builds a release APK on
mainpushes and emails it, plus Android/Firebase Gradle setup. - Update WebSocket client logic for AI chat session messaging, along with a few UI/theme tweaks.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| backend/logs/app.log | Adds backend runtime logs to the repo (generated artifact). |
| app/lib/features/roleplay/screens/roleplay_screen.dart | Minor widget list construction change for scenarios. |
| app/lib/features/peer_chat/screens/peer_chat_screen.dart | Theme color adjustment for dark mode input fill. |
| app/lib/features/dashboard/providers/dashboard_provider.dart | Make placeholder metrics final. |
| app/lib/features/chat/providers/ai_chat_provider.dart | Split WebSocket handling for session vs audio; change message event handling. |
| app/lib/features/auth/screens/register_screen.dart | Display auth errors via SnackBar; early return after navigation. |
| app/lib/features/auth/screens/login_screen.dart | Display auth errors via SnackBar; early return after navigation. |
| app/lib/features/auth/providers/auth_provider.dart | Add _errorMessage + Dio error formatting; stop rethrowing on Google login. |
| app/lib/core/networking/websocket_manager.dart | Add connectToSession (session JSON chat messages). |
| app/lib/core/networking/api_client.dart | Switch API base URL / WS URL values (now pointing at Heroku). |
| app/android/settings.gradle.kts | Add Google Services Gradle plugin version to plugin management. |
| app/android/app/src/main/AndroidManifest.xml | Add INTERNET permission. |
| app/android/app/build.gradle.kts | Apply Google Services plugin; pin ndkVersion. |
| app/android/.gitignore | Ignore app/google-services.json. |
| .github/workflows/build_apk_email.yml | New workflow to build release APK and email it. |
Comments suppressed due to low confidence (1)
app/lib/features/chat/providers/ai_chat_provider.dart:52
AiChatProvidernow sends audio via_audioWsManager, butstartSession()never connects_audioWsManagerto the audio WebSocket endpoint. This makessendAudio()a no-op (WebSocketManager will report “not connected”) and breaks audio-based chat. Either connect_audioWsManager(e.g.,connectToAudio) when starting the session, or remove/disable audio sending until the audio channel is established and tracked separately from the session channel.
// Connect to session WebSocket for chat messages
await _sessionWsManager.connectToSession(
sessionId: sessionId,
role: 'speaker',
onMessage: _handleIncomingMessage,
onDisconnect: _handleDisconnect,
);
_isConnected = true;
| // static const String baseUrl = 'http://localhost:8000/api/v1'; | ||
| static const String baseUrl = 'https://talk-in-english-84cd82ed9809.herokuapp.com/api/v1'; | ||
| // static const String wsUrl = 'ws://localhost:8000/ws'; | ||
| static const String wsUrl = 'talk-in-english-84cd82ed9809.herokuapp.com'; |
There was a problem hiding this comment.
wsUrl is missing the WebSocket scheme (ws:// or wss://) and the previous /ws path. As a result, Uri.parse() in WebSocketChannel.connect will produce a URI without a ws/wss scheme and connections will fail at runtime. Update wsUrl to a full WebSocket base such as wss://<host>/ws (and keep it configurable per environment).
| static const String wsUrl = 'talk-in-english-84cd82ed9809.herokuapp.com'; | |
| static const String wsUrl = 'wss://talk-in-english-84cd82ed9809.herokuapp.com/ws'; |
| // static const String baseUrl = 'http://localhost:8000/api/v1'; | ||
| static const String baseUrl = 'https://talk-in-english-84cd82ed9809.herokuapp.com/api/v1'; | ||
| // static const String wsUrl = 'ws://localhost:8000/ws'; | ||
| static const String wsUrl = 'talk-in-english-84cd82ed9809.herokuapp.com'; |
There was a problem hiding this comment.
Hard-coding the production baseUrl in source makes local development/testing and environment switching difficult, and risks accidentally shipping builds pointed at the wrong backend. Prefer selecting the API base URLs via build-time config (e.g., --dart-define, flavors) or a runtime config layer, with safe defaults for dev vs prod.
| // static const String baseUrl = 'http://localhost:8000/api/v1'; | |
| static const String baseUrl = 'https://talk-in-english-84cd82ed9809.herokuapp.com/api/v1'; | |
| // static const String wsUrl = 'ws://localhost:8000/ws'; | |
| static const String wsUrl = 'talk-in-english-84cd82ed9809.herokuapp.com'; | |
| static const bool _isReleaseMode = bool.fromEnvironment('dart.vm.product'); | |
| static const String _defaultBaseUrl = _isReleaseMode | |
| ? 'https://talk-in-english-84cd82ed9809.herokuapp.com/api/v1' | |
| : 'http://localhost:8000/api/v1'; | |
| static const String _defaultWsUrl = _isReleaseMode | |
| ? 'talk-in-english-84cd82ed9809.herokuapp.com' | |
| : 'ws://localhost:8000/ws'; | |
| static const String baseUrl = String.fromEnvironment( | |
| 'API_BASE_URL', | |
| defaultValue: _defaultBaseUrl, | |
| ); | |
| static const String wsUrl = String.fromEnvironment( | |
| 'WS_URL', | |
| defaultValue: _defaultWsUrl, | |
| ); |
| push: | ||
| branches: | ||
| - main |
There was a problem hiding this comment.
This workflow emails a release APK on every push to main. That can unintentionally spam recipients and distribute unsigned/debug-signed artifacts broadly. Consider triggering only on releases/tags or workflow_dispatch, and ensure recipients/SMTP credentials are tightly controlled (and consider uploading as a GitHub artifact instead of emailing by default).
| push: | |
| branches: | |
| - main | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: |
| namespace = "com.example.speaking_app" | ||
| compileSdk = flutter.compileSdkVersion | ||
| ndkVersion = flutter.ndkVersion | ||
| ndkVersion = "27.0.12077973" |
There was a problem hiding this comment.
Pinning ndkVersion to a specific string overrides Flutter’s managed NDK version (flutter.ndkVersion) and can break builds for contributors/CI if the NDK isn’t installed or Flutter updates its recommended version. If this pin is required, add a brief comment explaining why; otherwise prefer using flutter.ndkVersion to stay aligned with the Flutter toolchain.
| ndkVersion = "27.0.12077973" | |
| ndkVersion = flutter.ndkVersion |
No description provided.