Watched words triggered when editing old posts

Hi,

I’m not sure if what I am experiencing is intended behaviour or not, so I thought I would ask.

I have today added some words to watch for, profanity etc.

I have tread gently initially and just set Discourse to Flag the posts as inappropriate rather than take any action. This evening one post triggered this and I took a look - working really nicely.

I then searched the entire forum for some various words and found some posts which contained them. I edited the posts, replacing the word with asterisks. Having done this on about 4 posts I noticed that I now had four new flags!

It would seem that the version history of the post, which still contains the original word, is triggering a flag to be raised. When you view it you of course only see the most recent version and thus it isn’t clear as to why the post is deemed inappropriate.

Even as an Admin I am unable to edit previous versions of a post (as far as I know), so I don’t think there is a manual way to avoid this issue.

Any thoughts from those of you that work on / know the system much better than I?

3 Likes

I wouldn’t describe it that way – your edit of the old post with the “bad” word is triggering a run of the watched words check. I doubt @neil tested this scenario.

I’ve edited the title to more accurately reflect what is going on and changed to bug since this is definitely a bug IMO.

5 Likes

Hi Jeff,

Thanks for the feedback and clarity.

Sorry I often only bring problems and not solutions! :slight_smile:

I can’t reproduce this. Here’s what I tried:

  • As an admin user
  • find a post by a non-staff user
  • add a word in the post to the “Flag” list in Watched Words
  • edit the post to replace the word to “******”

Expect to see a new flag, but I don’t.

@RobMeade How can I reproduce?

1 Like

Hi @neil,

I have just had a post flag up on our hosted solution (GameDevTV). I will go in and amend the profanity that has been entered and record the steps to reproduce for you.

I will update this response in a few moments.


These steps are from a post already being reported(flagged) for inappropriate content and does not create the flag.

  • Click on Flags

    image

  • Click on the topic title

  • Click on the Edit tool

    image

  • Edit the offending text

    image

  • Enter a Reason for Edit

  • Click on the Save Edit button

  • Return to the Flags page

  • Click on the Agree button, choosing Agree (e.g. not sending a PM)


These steps are where a search is performed to find posts that contain the watched word (e.g. were posted before the watch words were added);

Additional step to create content to test against

  • Create a post using a word which is currently not in the Watched Word list, for example; kowabunga

Steps

  • Add the watched word to the Watched Word list

    image

  • Perform a search across the forum for the newly added Watched Word (e.g. kowabunga)

    image

  • Click on the topic title

  • Click on the Edit tool

  • Replace the offending word

    image

  • Enter a Reason for Edit

  • Click on the Save Edit button


At this time, this has not triggered a flag to be generated. That said, I just posted with a word that was already on the Watched Word list and that didn’t either.

Question

  • Are Watched Words checked for instantly, or as part of a job that runs periodically in the background?
  • If an Administrator posts, does this get excluded from the checks?

In the above, I posted using my Administrator account, and nothing has appeared at all yet (within 10 minutes of posting)


Related Issue

On a very related, although not specifically the same, matter, we have had images uploaded which contained a Watched Word in the filename. These escape any form of validation and are allowed to be uploaded.

I have tried;

  • download the original image
  • save it locally with a new name
  • edit the post, delete the image
  • re-upload the image with the amended file name

But the alt/hover/title text remains as per the original image.

I suspect there is perhaps some cleverness going on in the background to determine if the image was in fact the same image and thus not upload it again.

The only way I have been able to circumvent this was to save the image locally with a different file extension (e.g. jpg instead of png or vice versa), then the image was treated as a new image and the alt/hover/title text was corrected also.


Staff are excluded from the checks, so what you’re seeing is correct. So those steps are the same as what you reported in your first post?

1 Like

Hi @neil,

That explains why my reproduction didn’t quite work then. The original posts were posted by other people, non staff, so the steps I posted were not exactly the same as the first time around - the different behaviour between staff / non-staff only became apparent as I was writing the steps - sorry.

I have had an opportunity to resolve one of these this evening and no duplicate flags appear to have been raised - needless to say I am a little confused, it most certainly did before because I recall editing four previously posted posts, asterisking the words, and then four flags appearing for those posts - this wouldn’t have been something that was cached because this was me searching for the posts in the first place that may contain the specific words. The only wording that was on the watched words was in the history for each post after I had submitted the edited version.

I am at a loss as to why this isn’t happening at the moment?

Any thoughts with regards to the related issue I mentioned too - regarding the images?

2 Likes

I had been testing on posts made by trust level 0 and 1 users, but was also unable to recreate the problem.

As for the uploads, it sounds like the words are introduced after processing the uploads.

3 Likes