Forum post editing timeout issue

Bug #731990 reported by Ruslan Kabalin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Medium
Ruslan Kabalin

Bug Description

We have postdelay forum config parameter that defines for how long it is allowed to edit the post after it has been submitted. Say it is set to 30 mins. When user decides to edit the post just before timeout, s/he will be allowed to do so, but submission might not be possible due to the timeout (Access denied error).

What I suggest is to make possible to submit the post even if time is out (but editing was initiated before timeout).

Revision history for this message
François Marier (fmarier) wrote :

That's indeed a very annoying behaviour.

However, the solution sounds a bit complicated (and error prone). We'd need to have a new timeout (how long somehow has to edit a post) and keep track of when editing was started.

A few scenarios to consider:

- user clicks edit and submits the edited post 3 hours later
- user clicks edit and never submits the form
- user clicks edit and submits the edited post just after the "editing duration timeout"

A simpler approach to the problem described by Ruslan would be to add a message like this in bold above the edit box when editing a comment:

"You have 25 minutes to edit this message. Make sure you submit this post before 11:35pm (server time) or the original one will be emailed out instead."

We could even have a Javascript countdown...

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

As a possible solution, the edit time could be stored in the session when editing is initiated and substituted instead of $post->ctime on the edit submission. This will allow to submit the last post edit within "postdelay" value (e.g. 30 mins) since edit button was clicked. The patch below implements it. It also ensures that there is no mangling with stored edit time (e.g. by starting editing other post while post edit window is open to amend the time for the first post) as the post/topic id is also stored. It only allows editing one post/topic at the time at the moment.

tags: added: forum post timeout
Revision history for this message
François Marier (fmarier) wrote :

Maybe I'm missing something here, but by essentially moving the check from the server to the client (i.e. in the session) then what's to prevent me from changing my session and editing the post hours after it has been sent out via email?

Or more simply clicking the "edit" link, leaving the browser tab open and editing the post after it's been sent out. The email and the online version will not match anymore. Is this desirable?

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

>what's to prevent me from changing my session and editing the post hours after it has been sent out via email
It will not let you to start editing if more than 30 minutes has passed from the time when you opened edit window. But, I agree, email sending has not been considered.

I had another thought. Say if editing time will be recorded in interaction_forum_edit when edit has been started and incomplete record will be cleared by cron if the submission has not been made within 30 mins. When submission is made, 'mtimeend' will be recorded in the same table. Email will not be send out if incomplete record in interaction_forum_edit will be indicating that editing is in progress. Also this will give us a possibility to display editing history for ordinary users.

Revision history for this message
François Marier (fmarier) wrote :

You latest idea does sound like it would work.

The one thing that worries me however, is that it would increase the complexity of sending forum emails quite a bit and might lead to bugs that are much harder to find/fix.

Going back to the problem we are trying to solve: the mismatch between a user expecting to be able to edit something and then not being able to edit that post because the deadline has passed. In other words:

1- the error message sucks (i.e. "Access denied" != "Deadline has passed")
2- there is no visibility as to how much time you have left because the message is sent out

Both of these things could be addressed without changing the email delivery workflow. Is that anything else you think may need to be addressed?

Revision history for this message
Ruslan Kabalin (rkabalin) wrote :

For the case when email notification workflow is not changed, there is nothing else I can think about.

Revision history for this message
François Marier (fmarier) wrote :

I guess I was wondering whether I had missed anything in terms of defining the problem we are trying to solve (as opposed to describing a possible solution).

Cheers,
Francois

Revision history for this message
François Marier (fmarier) wrote :

From the 2011-03-23 developer meeting:

<rkabalin_> I think we probably should just indicate how much time left when editing page is open rather than doing complicated stuff

Changed in mahara:
assignee: nobody → Ruslan Kabalin (ruslan-kabalin)
importance: Undecided → Medium
status: New → Confirmed
milestone: none → 1.4.0
Changed in mahara:
status: Confirmed → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.