Posts hidden via flagging cannot be edited if beyond the maximum edit time limit


(cpradio) #1

Continuing the discussion from Editing Old Posts and Adding Links Doesn’t Alert Anybody:

Can we make the above change (granted, that might not be the actual code… but the idea behind it is simple:

Repro Steps (requires 2 accounts - one moderator or higher and one normal user)
Set Edit Window to something small (such as 10 minutes)

  1. Login as normal user, create a post, wait 10 minutes for edit icon to disappear
  2. Logout as normal user, login as moderator
  3. Find post created by normal user, flag as inappropriate and choose Take Action, logout
  4. Login as normal user, read PM, wait 10 minutes (per PM), visit post, edit icon isn’t available
  5. Login as moderator/admin, change edit window to 1 day, logout
  6. Login as normal user, you can edit your post now.

New users with only 1 post can delete their account?
(Jeff Atwood) #2

I am unclear. The bug is that the owner cannot edit their hidden post?


(TechnoBear) #3

The problem is that the edit window runs from the time the post was made. If the post is flagged after that edit window has expired - or during the edit window, but the member doesn’t return before it closes - they receive a message telling them they must edit their post, but they’re unable to do so. (And the post can only be “unhidden” by the member editing it, so it remains in limbo.)


(Jeff Atwood) #4

Edits are blocked for 10 minutes after the flagging threshold is reached, so the user does not rage-edit their post, without thinking, and has time to cool down.

Editing the hidden post is allowed 10 minutes after the flagging threshold was reached and caused the post to be hidden. You can think of this as 10 minutes after the PM was sent notifying the user of the hidden post since the hide and the PM occur at the same time.


(TechnoBear) #5

Yes, I understand the 10-minute cooling-off period. But if the standard post-editing window - whatever that may be set to - expires before those ten minutes are up, the member will never be able to edit the post.


(Jeff Atwood) #6

OK if that is the case, then it is definitely a bug.


(Kane York) #7

Well this brings up the question of ‘why is the edit window so short’?

There are plenty of ways to shoot yourself in the foot, so to say, with the site settings. (e.g. default trust level 4)


(cpradio) #8

It isn’t short per say, I did that in my repro to make it easier to reproduce. But we allow several days for a user to edit their post. I just wanted to give a very easy repro that didn’t involve waiting days to see the bug happen ;).


(Jeff Atwood) #9

Oh you guys are referring to a mythical site where NO user can edit their posts for more than a few minutes, as a global setting override. Yeah, that’s a much narrower case.


(TechnoBear) #10

In the case in point, the editing window is set to 24 hours, to prevent members returning long after posting and inserting Spam links. (On vBulletin, that window was set to just 30 minutes for the same reason.)

So a member could make a post in a lesser-used area, where it maybe isn’t flagged until a few hours later - or maybe even next day. They get a message telling them to edit the post, but by the time they return, the edit window has closed.


(cpradio) #11

No. No, we are not. I did that in my repro to make it easy to reproduce. We allow much longer than a few minutes.

I thought it was 3 days, but I don’t have access to see what the actual setting is, but that doesn’t matter.


(Mittineague) #12

AFAIK it was decided for it to be 3 days to allow for situations where the member might not visit the site during a weekend, But that setting might not have happened or might have changed.

But that is a red herring here.


(Jeff Atwood) #13

This would also happen if a post was flagged to threshold and hidden any time after the default 6 month maximum edit window for posts.

Setting the edit threshold to, say, 10 minutes would exacerbate the problem but it still remains. If a five year old post was flagged to threshold and hidden, does that also force the five year old post into an editable-by-owner state?


(cpradio) #14

The owner should have the opportunity to edit it to get it unhidden, As why send them a PM telling them to edit it, if they can’t?


(Jeff Atwood) #15

It is definitely a bug, just pointing out that you have a problem with older posts at some point.


#16

Is it one that’s slated for a quick fix? It’s a fairly major hole in the system if we send a PM to someone telling them to edit their post to fix it when they don’t have the ability to do so…


(Jeff Atwood) #17

Possibly @neil or @eviltrout could you take a look at this tomorrow? The code needs to skip the absolute maximum edit time check here.


#18

Can’t ask for better than that. Appreciated.


(Robin Ward) #19

I’ve got a commit ready, should be in tests-passed shortly:

https://github.com/discourse/discourse/commit/309b67add47702ed3a2139740a54c6f0454f28db


(Sam Saffron) #20