Skip to content

fixed mobile login issue and created ci cd to send apk build over mail#22

Merged
unstoppableayush merged 1 commit intomainfrom
mob_app
Apr 29, 2026
Merged

fixed mobile login issue and created ci cd to send apk build over mail#22
unstoppableayush merged 1 commit intomainfrom
mob_app

Conversation

@unstoppableayush
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 29, 2026 19:12
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
talk-in-english Ready Ready Preview, Comment Apr 29, 2026 7:12pm

@unstoppableayush unstoppableayush merged commit eae96e5 into main Apr 29, 2026
4 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 errorMessage handling in AuthProvider and show SnackBars on login/register + Google sign-in failures.
  • Introduce a GitHub Actions workflow that builds a release APK on main pushes 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

  • AiChatProvider now sends audio via _audioWsManager, but startSession() never connects _audioWsManager to the audio WebSocket endpoint. This makes sendAudio() 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';
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
static const String wsUrl = 'talk-in-english-84cd82ed9809.herokuapp.com';
static const String wsUrl = 'wss://talk-in-english-84cd82ed9809.herokuapp.com/ws';

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +7
// 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';
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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,
);

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
push:
branches:
- main
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
push:
branches:
- main
release:
types:
- published
workflow_dispatch:

Copilot uses AI. Check for mistakes.
namespace = "com.example.speaking_app"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
ndkVersion = "27.0.12077973"
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
ndkVersion = "27.0.12077973"
ndkVersion = flutter.ndkVersion

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants