openfoodfacts / smooth-app

The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
774 stars 267 forks source link

App shows wrong credentials when servers aren't reachable. #4766

Closed AshAman999 closed 9 months ago

AshAman999 commented 9 months ago

What

Steps to reproduce the behavior

  1. Go to Profile
  2. Click on 'Sign in.'
  3. Enter your credentials
  4. See error

Expected behavior

The app should show proper message something like loading failed or similar

Why

Part of

Screenshot/Mockup/Before-After

Your Image

Smartphone model

Additional context

Ps: I am trying to sign in with my email, I think that shouldn't be the problem. Probably some wording with error messages is the cause. packages\smooth_app\lib\pages\user_management\forgot_password_page.dart

monsieurtanuki commented 9 months ago

@AshAman999 The server is rather slow today anyway. You're right, we should make the difference between server down, no internet and wrong user/pwd. Fix needed in user_management_provider.dart (Future<bool> login(User user) async {).

teolemon commented 9 months ago

Good catch 🙂

monsieurtanuki commented 9 months ago

Could be extended to the other cases when the server is down (Exception: JSON expected, html found: <head><title>504 Gateway Time-out</title></head>) or the connection is down. cf. https://openfoodfacts.sentry.io/issues/4409784503/?notification_uuid=c6252a4b-36fc-4a57-bba7-b71fbe4cf870&project=5376745&referrer=weekly_report