AOSSIE-Org / AOSSIE-Org/BabyNest

BUG: Network Error on Android & Inconsistent BASE_URL Configuration

Ouverte
#137 3 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
JavaScript
Étoiles
56
Forks
123
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### What happened?

## 📌 Issue Overview
I am encountering a TypeError: Network request failed when running the application on the Android Emulator. Upon investigating the codebase, I found that the backend URL configuration is inconsistent across different services, leading to connection failures when the backend is running locally.

## 🔍 Steps to Reproduce
1. Start the backend server (python manage.py runserver).
2. Start the Android emulator and run the frontend (npx react-native run-android).
3. Launch the app.
4. Observe the "Network Error" in the console or UI when the app attempts to fetch data (e.g., during onboarding or profile checks).

OS: macOS
Platform: Android Emulator
Backend Port: 5000

## 🎯 Expected Behavior
Frontend should be able to communicate to backend without doing adb reverse

## 🚨 Actual Behavior
The app fails to connect to the backend with a Network request failed error.

OnBoardingScreen.jsx uses the BASE_URL from .env (currently set to a specific local IP 192.168.1.4).

ConversationContext.js ignores the .env import and falls back to http://127.0.0.1:5000, which is not accessible from the Android Emulator without adb reverse.

## 📷 Screenshot

## 💡 Suggested Improvements
1. Standardize Imports:
Update ConversationContext.js to import BASE_URL from @env like other files (ActionExecutor.js, RAGService.js).

2. Update Default Config:
Change the default BASE_URL in .env to http://10.0.2.2:5000
(the standard alias for the host machine in Android Emulator)
or http://localhost:5000
(requiring adb reverse).

### Record

- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on this issue

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.