NMF-earth / nmf-app

Understand and reduce your carbon footprint 🌱 iOS & Android.
https://nmf.earth
GNU General Public License v3.0
508 stars 157 forks source link

Bug: Open Food database CO2eq overridden by 200kg after adding scanned emission #379

Closed DGrothe-PhD closed 1 year ago

DGrothe-PhD commented 1 year ago

Describe the bug Scanned product is stored as having 200kg CO2eq instead of its actual value.

To Reproduce Steps to reproduce the behavior:

  1. Go to Add Emission → Scan Product
  2. Scan a product which has a CO2eq value in Open Foods Database
  3. Confirm that the slider appears to set item count (preset: 1 item) and there is a CO2eq value (usually below 10 kg) shown.
  4. Press the Add emission button
  5. Check the monthly emission screen and look at the item just stored

Expected behaviour On monthly emission screen, an amount of CO2 for a food item taken from Open Foods Database should show the correct value.

Screenshots Please find below.

Please complete the following information (if applicable):

Product screenshots for easily retrying cocomilk peanutbutter_front peanutbutter_EAN

Scanning process scanning_cashew_cranberry_mix scanning_coco scanning_peanut And afterwards: EmissionsScreen_with3

Additional context (I was trying to debug but had couple of yarn issues so had to skip this.)

saurabhchatterjee23 commented 1 year ago

https://github.com/NMF-earth/nmf-app/pull/386 fixed the issue in this PR