Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grey screen on some product, on some knowledge panels #2682

Closed
teolemon opened this issue Jul 31, 2022 · 1 comment · Fixed by #2684
Closed

Grey screen on some product, on some knowledge panels #2682

teolemon opened this issue Jul 31, 2022 · 1 comment · Fixed by #2684
Assignees
Labels
🐛 bug Something isn't working 📖 Knowledge panels

Comments

@teolemon
Copy link
Member

What

  • Documentation in progress…

Steps to reproduce the behavior

  1. Go to 3256540000698
  2. Click on the knowledge panels related to ingredient analysis
  3. See error

Screenshots

image
image
image

@monsieurtanuki
Copy link
Contributor

As far as I understand KP, it looks like the data we get from the server is slightly corrupted.
In particular, for vegan and vegetarian, the elements refer to a panel that does not exists in the rest of the JSON ("ingredients_analysis_help"). And that's the reason of the crash: a null panel where we expect one.

Is there something we're missing in Smoothie's parameters that prevents us from getting the "ingredients_analysis_help" panel? I don't know.
Anyway, we could play it robust and take into consideration the possibility of a null panel without crashing.
About to PR...

"ingredients_analysis_en:non-vegan": {
	"elements": [{
		"element_type": "text",
		"text_element": {
			"html": "\n                \n                    <strong>Ingrédients non végétaliens :</strong>\n                    Œuf frais, Matière grasse butyrique, Lait en poudre écrémé, Protéine de lait\n                \n                    ",
			"type": "summary"
		}
	}, {
		"element_type": "panel",
		"panel_element": {
			"panel_id": "ingredients_analysis_help"
		}
	}],
	"evaluation": "bad",
	"level": "info",
	"size": "small",
	"title_element": {
		"icon_color_from_evaluation": true,
		"icon_size": "small",
		"icon_url": "https://static.openfoodfacts.org/images/icons/dist/leaf.svg",
		"title": "Non végétalien"
	},
	"topics": ["health"]
},
"ingredients_analysis_en:vegetarian-status-unknown": {
	"elements": [{
		"element_type": "text",
		"text_element": {
			"html": "\n                \n                    <strong>Ingrédients non reconnus :</strong>\n                    Levain\n                \n                    ",
			"type": "summary"
		}
	}, {
		"element_type": "panel",
		"panel_element": {
			"panel_id": "ingredients_analysis_help"
		}
	}],
	"evaluation": "unknown",
	"level": "info",
	"size": "small",
	"title_element": {
		"icon_color_from_evaluation": true,
		"icon_size": "small",
		"icon_url": "https://static.openfoodfacts.org/images/icons/dist/vegetarian.svg",
		"title": "Caractère végétarien inconnu"
	},
	"topics": ["health"]
},

monsieurtanuki added a commit to monsieurtanuki/smooth-app that referenced this issue Jul 31, 2022
Impacted file:
* `knowledge_panel_element_card.dart`: no more trying to display panels that do not exist
monsieurtanuki added a commit that referenced this issue Jul 31, 2022
Impacted file:
* `knowledge_panel_element_card.dart`: no more trying to display panels that do not exist
Repository owner moved this from To discuss and validate to Done in 🤳🥫 The Open Food Facts mobile app (Android & iOS) Jul 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 📖 Knowledge panels
Development

Successfully merging a pull request may close this issue.

2 participants