Disappearing/appearing comment issue
Update: found how to reproduce this by adding a #url-hash to the end of the URL, which causes comments not to be shown, oddly. See comment below.
Reporting from @Fastie, and seemingly distinct from now-solved #797 --
I posted a comment on this question, but the comment did not display in Chrome. Then I posted the same comment again, and it still did not display. The page indicated that there were two comments, but did not let me see them. Then I posted the same comment on Jeff's existing answer to that question and it displayed normally. The next day I noticed that my two comments on the question were still not displaying, but later I noticed that the all three copies were displaying normally in Chrome and in Internet Explorer. So I deleted two of the copies including the copy on Jeff's answer. Later I noticed that my single comment (on the question) was not displaying, but 30 minutes later it was displaying. I have noticed similar behavior on other questions. It seems that the question page often indicates that there is a comment on the question, but there is no way to display that comment.
I think this probably needs some tests written. It could be a page caching issue -- @Fastie, did you go "back" to any of these pages, or did the display/non-display persist across hard page refreshes? I'm assuming the latter.
I do think this related issue @Fastie is reporting is related to shown/hidden comments when deep linking to a comment:
This link: https://publiclab.org/questions/liz/09-28-2016/what-are-important-aspects-to-consider-about-replication-on-the-website-and-in-the-community#anwer-0-comment does not allow the comment to be displayed. This is the link from the dashboard if you click "1 comments." This link: https://publiclab.org/questions/liz/09-28-2016/what-are-important-aspects-to-consider-about-replication-on-the-website-and-in-the-community displays the comment normally.
Either we need to double check (with tests, perhaps in Jasmine) that deep linking to a comment will properly display the comment, or we could fall back to a temporary fix that simply shows all comments.
@ananyo2012 - just noting that you've claimed this one; i'll assign it to you if that's OK!
A neat url for a question displays comments on the question. So this url displays comments: https://publiclab.org/questions/liz/09-28-2016/what-are-important-aspects-to-consider-about-replication-on-the-website-and-in-the-community
But if that url is extended to specify a comment or comments like this: https://publiclab.org/questions/liz/09-28-2016/what-are-important-aspects-to-consider-about-replication-on-the-website-and-in-the-community#c15543 or this: https://publiclab.org/questions/liz/09-28-2016/what-are-important-aspects-to-consider-about-replication-on-the-website-and-in-the-community#comments
then no comments display.
Actually i wonder if this could be also two issues - one cache related -- i tried going back to a page I'd just answered a question on: https://publiclab.org/questions/glenc/10-12-2016/lightweight-air-quality-sensors-for-a-weather-balloon and didn't see the answer. But on refresh it appeared (which suggests my browser had just cached the version without, before I answered) and persisted.
However, Chris's very helpful comment is /highly/ suggestive (to me) that there is a problem with the hiding/showing logic based on the #url-hash as well. @ananyo2012 - can you point us at where that logic lives, in the code? Thanks!
Yes! Similarly I can't see the comments when going to this URL: https://publiclab.org/questions/warren/09-13-2014/riffle-coqui-hot-cold-tapwater-test#answer-comment-15619
Which I got to via the email notification -- in this template: https://github.com/publiclab/plots2/blob/master/app/views/comment_mailer/notify_note_author.html.erb#L9
However without the #url-hash at the end, comments do show: https://publiclab.org/questions/warren/09-13-2014/riffle-coqui-hot-cold-tapwater-test
This definitely could be investigated by testing if comments are shown in a Jasmine javascript test.
@ananyo2012 - any idea why the use of a url.com/path#hash at the end of a URL would cause comments not to show? Or a next step we could add here to make it easier to solve?
The pattern I described previously is not universal. Previously I observed that neat URLs allowed the comments to be displayed, but this question breaks that pattern.
https://publiclab.org/questions/idev247/12-06-2016/ambient-light-bulb-testing
There are two answers to the question. The three comments on one answer can be displayed, but the five comments on the other answer cannot be displayed.
Yeah its a bug caused due to to the anchor text in url. Please give me some time. I will have a look.