NMF-earth/nmf-app

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

DGrothe-PhD opened this issue · 1 comments

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):**

  • Device: iPhone 12]
  • OS: iOS 16.5
  • Version 0.10.0-50

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

#386 fixed the issue in this PR