Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Fix Flutter transaction anomaly detection request handling

Aperta Adatta ai principianti
#4,164 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
70/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
dart, flutter
Ambito
mobile

Direzione di ricerca

Controlla il file pubspec.yaml dell'app Flutter per assicurarti che il pacchetto http sia elencato. Trova il file con l'importazione 'import "http" as http;' e cambiala in 'import "package:http/http.dart" as http;'. Quindi individua la funzione di richiesta di rilevamento anomalie transazioni e aggiungi la gestione degli errori per risposte non 2xx, errori di rete e parsing JSON. Assicurati che l'URL di base dell'API sia configurabile, magari tramite una variabile d'ambiente o un file di configurazione. Testa eseguendo l'app e simulando errori API.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage
Short summary

Flutter transaction anomaly detection request fails to compile and cannot be reliably exercised because the HTTP client import is invalid and request failures are not handled.

Affected version or release

Not specified in the source report; the affected application is a Flutter app using a development API endpoint.

Installation context

Flutter application using the AI Shield India transaction flow; requests target the development API endpoint at 10.0.2.2:8000.

What happened?

The Flutter application imports the HTTP client as import 'http' as http;, but the code calls http.post. This import does not reference the package library and prevents the app from compiling unless corrected to import 'package:http/http.dart' as http; and the http dependency is declared in pubspec.yaml. After compilation is fixed, the transaction flow should handle non-2xx responses, network and timeout failures, and invalid JSON without crashing. The API base URL should also be configurable for emulator, device, and production environments.

Steps to reproduce
  1. Create or open the Flutter application containing the AI Shield transaction flow.
  2. Ensure the code contains the HTTP import import 'http' as http; and calls http.post.
  3. Run the application or compile the project.
  4. After correcting the import, invoke the Test High-Value Transfer action with the development API unavailable or returning an error.
  5. Observe the compilation failure or unhandled request/JSON failure.
Expected behavior

The app should compile with the HTTP package configured, send the transaction request successfully when the API is available, and show a user-friendly error when the API returns a non-2xx response, times out, cannot be reached, or returns invalid JSON. The API base URL should be configurable per environment.

Additional context

The original implementation uses http://10.0.2.2:8000/api/v1/detect-anomaly, which is emulator-specific and uses cleartext HTTP. Confirm the Android network-security configuration or migrate the endpoint to HTTPS. The request includes user ID, amount, current and previous locations, and screen-sharing state.

Lingua principale
Nessun dato sulla lingua
Stelle
2.1k
Fork
157
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di github/app

Tutte le issue di github/app

Issue simili

Altre issue su Mobile Dev

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.