Skip to content

The Nutrition game does not reset the serving size between products #1265

@fgouget

Description

@fgouget

What

The Nutrition game does not reset the serving size when switching to a product for which it is unset. This can cause the player to unwittingly propagate it from one product to the next.
The exact conditions to trigger this bug are as follows:

  • Manually set the serving size on the first product
  • The next product not having a serving size in the OpenFoodFacts database
  • The user not touching the serving size field and just sending his other fixes for that second product

Steps to reproduce the behavior:

  1. Log in and open https://hunger.openfoodfacts.org/nutrition
  2. Open the View Product link in a new tab, return to the Hunger Games page
  3. Set the serving size to "bug"
  4. Fix the other issues and click on Send
  5. If the serving size field got reset, go back to step 1
  6. Otherwise open the View Product link in a new tab, return to the Hunger Games page
  7. Fix the issues as usual but do not touch the serving size field in any way
  8. Click on Send
  9. Go to the tab containing that product's page
  10. Take note of the serving size
  11. Reload the page, the serving size is now "bug"
  12. Fix the serving size (if you forgot the serving size, use the product's edit history to recover it)
  13. Fix the serving size of the products in all the other tabs you opened!!!

Expected behavior

  • The nutrition game should always set the serving size field, even if that field is not set for the product.

Platform (Desktop, Mobile, Hunger Games)

  • Browser: Firefox 141.0
  • OS: Debian 12

Part of

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    To Discuss & Validate

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions