hypothesis / support-legacy

a place for tracking support-related work and projects
3 stars 0 forks source link

Moderated annotations still have their Annotation Cards appear without body text or tags #193

Closed mkdir-washington-edu closed 3 years ago

mkdir-washington-edu commented 3 years ago

Describe the bug As an example: https://hyp.is/TOsqbSh0QnqwknVwNZfMlw/web.hypothes.is

This annotation has been flagged and hidden by the moderator. The annotation text and the tag is not visible on the Card, but the Card itself and the selected text are visible to non-moderators.

To Reproduce Steps to reproduce the behavior:

  1. Log in as the Hypothesis Public moderator
  2. Visit https://hyp.is/TOsqbSh0QnqwknVwNZfMlw/web.hypothes.is
  3. Note the annotation is hidden.
  4. Log in as a non-moderator
  5. Visit https://hyp.is/TOsqbSh0QnqwknVwNZfMlw/web.hypothes.is again
  6. Note the annotation Card is visible

Expected behavior Non-moderators should not see the annotation card.

Desktop (please complete the following information):

mkdir-washington-edu commented 3 years ago

Non-moderator account: image

Moderator account: image

klemay commented 3 years ago

@mkdir-washington-edu the developers are having a hard time repro-ing this locally. They can see it happening live in the Public channel, but can't make it happen in local dev environments (which is necessary, in order to find and solve the problem). While they continue to investigate this, it would be helpful for the support team to try and repro in a private group. That would at least tell us whether this is unique to the Public channel

mkdir-washington-edu commented 3 years ago

I posted this in Slack, but just to make sure we're all on the same page, I can not create annotations that do this, either in Public or in a private group.

LMS007 commented 3 years ago

To reproduce this, you have to create a top level annotation as lets say with user1, and then someone else has to reply to it (say, user2), then flag it. Then, as an admin, you can see the red moderation banner, and "hide" it. When you log in as the second user again (user2), you will still see the top level card, absent of text, but you can see the highlight and the reply.

If you don't reply to the annotation, it will hide the entire card. The key difference is there has to be a reply.

I'm assuming the the expected behavoir will be to hide the card and every reply is might have? OR should we render something like we do for replies that are flagged but have sub-replies like this?

Screen Shot 2021-05-10 at 3 30 01 PM

robertknight commented 3 years ago

Hi @LMS007 - this is a useful finding, but the screenshots in the issue description and direct-linked annotation appear to show annotations that do not have replies. Can you figure out what is going on there?

LMS007 commented 3 years ago

Oh sorry, yes, the screen shot was simply to demonstrate what we do when we hide a reply, but also has a sub-reply. You can see "Message not available"

I could image we could do something similar with a hidden top-level annotation that has replies, or we just hide the replies too?

klemay commented 3 years ago

We would like to implement something similar for top-level annotations ("Message not available" when top level annotation has been hidden) - see https://github.com/hypothesis/product-backlog/issues/1106

I think for now, we just want to know why the cards for these annotations with no replies aren't being hidden as expected

LMS007 commented 3 years ago

Awe, i misunderstood. Rob pointed out that the screen shot with the 3 annotations in question, which are not hidden, don't have a replies. But my method for reproducing this requires replies. I will also point out that you can simulate this result by deleting the replies on a flagged annotation. In that case you end up with the card not being hidden and no replies. That could have been the case here, but it's only a theory and we may have to look up logs to confirm.

LMS007 commented 3 years ago

Some observations to push this along.

If i simulate the situation where I create an annotation as user1, then reply to it, flag it , and hide it (as admin), then delete the reply (as admin) and log in as a different user (user2) where I see the card and highlighted text, I also observe that the json result from http://localhost:5000/api/search is the following

As user2 Screen Shot 2021-05-11 at 5 05 12 PM

I can see the single root thread annotation, and its flagged status is false and hidden status is true. Also, the text value is a blank string, so that part is appropriately hidden.

When I log back in as an admin, I see the following

As admin Screen Shot 2021-05-11 at 5 12 52 PM

And finally, to round things out,

As user1 Screen Shot 2021-05-11 at 5 16 11 PM

There are 2 annotations now, one of them was flagged+hidden with a reply, and one without. I do find it curious that the admin can't see the hidden annotation anymore that had no replies. In other words, once you hide them, then refresh the page, its gone. I don't do much moderation, so that may be a very ignorant question.

In anycase, I still can't replicate this bug outside of creating a reply and then deleting it, and perhaps that's a starting point. I also wonder where the "hiding" responsibility lies. It seems to me that this is service level. But currently, hidden annotations that have or have had replies, are not omitted from api/search. Is that by design?

robertknight commented 3 years ago

In anycase, I still can't replicate this bug outside of creating a reply and then deleting it, and perhaps that's a starting point. I also wonder where the "hiding" responsibility lies. It seems to me that this is service level. But currently, hidden annotations that have or have had replies, are not omitted from api/search. Is that by design?

This is a useful discovery. The "or have had replies" part in particular seems like a backend issue. It is unexpected IMO that there should be a difference between an annotation that never had replies and an annotation which had replies in the past that have since been deleted.

Might be worth having a comb through the backend code for references to hidden in case there is documentation or code that explains the expected behavior.

A possible next step I think would be to create a bug report in h expressed in terms of the API calls to the backend required to reproduce it.

LMS007 commented 3 years ago

I have created a back end ticket with more detailed behavior and cases. As this point I am assuming that this fix will be in h. https://github.com/hypothesis/h/issues/6643

There may be follow up client work as well

LMS007 commented 3 years ago

Closing this ticket out, no expected client side work for now