Consider adding logic that detects invalid letter grades before rendering the review reliability component
Categories
(Firefox Graveyard :: Shopping, defect, P3)
Tracking
(Not tracked)
People
(Reporter: kpatenio, Unassigned)
References
Details
(Whiteboard: [fidefe-shopping])
Attachments
(1 file)
|
51.34 KB,
image/png
|
Details |
While testing code locally, I noticed that we receive a grade: "?" from the API for some product pages. Ex. https://www.amazon.com/dp/B07QH7ZXH3
Although this will likely be fixed from the backend, I wanted to file this ticket in case we're interested in updating how we render the review-reliability component. Currently, we check if the grade is null before proceeding to render the reliability component. But we don't take into account what the string values passed in are. We only check if valid letters are passed once we render the letter grade component.
Updated•3 years ago
|
Niklas pointed out the returned data can be like: needs_analysis: false, grade: "?", highlights: {}.
Perhaps we get this when a product doesn't have enough reviews? If so, this is equally relevant to Bug 1844828.
The "?" grade was a bug on the fakespot side--the API should never return the "?" grade. This should be fixed on staging; once verified, I think we're good to close this. For future reference, the fakespot tracking bug was https://mozilla-hub.atlassian.net/browse/FAK-202
eh, closing.
Note that, if we choose to set validation to be strict in production, an unexpected letter grade will throw an error and not be displayed at all. (I don't know if we want to go that far, but it's something we'll want to discuss)
Updated•1 year ago
|
Description
•