openfoodfacts / power-user-script

User script for your browser, to empower Open Food Facts contribution
GNU Affero General Public License v3.0
12 stars 5 forks source link

List edit mode can show mismatched ingredients #42

Closed svensven closed 3 years ago

svensven commented 3 years ago

In list edit mode, the pictures and links on the left come from the original load of the page, but the ingredients and action buttons come from re-running the search as JSON at the time shift-L is pressed. If the results have changed or changed order, because records in the list have been edited in between, the ingredients will appear to be wrong for each item.

E.g. loading the front page, with its list of recently updated records, waiting till a record has been edited, then pressing shift-L, results in: image

where ingredient boxes 3-6 are one row below where they should be, because a new record is in position 2.

svensven commented 3 years ago

From https://github.com/openfoodfacts/openfoodfacts-server/issues/3981

svensven commented 3 years ago

ca793fbaeeff483c0324a5da40f138b4bfb888b2 fixes the mismatch. if the json doesn't return data for a search result entry, the edit tools just won't show for that row now.