[bug] [web] Can't load discussion for some sentences
When I click the "Discuss sentence" button, there is a console error, and nothing renders. I can progress through the remainder of the lesson normally, but the "Discuss sentence" button no-ops for the remainder of the lesson.
An example of a sentence that is not affected is sentence 10d15867cbe43e324f5557b501460f34. (Content: "Το ξέρω.")
An example of a sentence that is affected (i.e., fails to render) is sentence eca919975fe88042df6b12aebb17e76b. (Content: "Εγώ βάζω.")
The JSON data returned from their respective endpoints is different.
The error appears to be that the JSON data returned from the bad response has a
comment field, but no
comments subfield. Consequently,
this.model.get("comment").get("comments").toJSON() resolves to
(null).toJSON(), which fails. The underlying issue could be that the sentence is marked as having comments (
"has_comment": true) when in fact there are no comments listed.
This bug is reproducible (100% repro rate upon page refresh; these two sentences happen to be at the start of my skill "Verbs: Present 1", lesson 6).
Let me know if you need any more information.
I suspect this has to do with moderator actions on the affected discussions. Maybe deleting the last comment in a thread doesn't reset "has_comment" to false like it should?
Hopefully the information you've provided helps the devs track down the issue. It's been a problem for a long time (years now).
Edit: There's also a related issue where once this occurs, it continues to fail for every future sentence in the lesson.