[Pmwiki-users] Brainstorm (Page Locks)

Steven Leite steven_leite
Thu Apr 8 11:59:55 CDT 2004


More discussion about the Page Locks idea:

I don't think it's un-reasonable to prevent an author from editing a
document if another author is already editing that document.  I know I would
get really annoyed if i was making some critical revisions to a document and
somebody came  along and started editing and saving an possibly overwriting
my changes (perhaps without even knowing that I was editing that same
document).

> ... a person would have to wait until 10 minutes after the
> previous person finishes editing -- i.e., if the original author
> presses preview then the lock is extended by another 10 minutes.
> Thus, the person waiting really doesn't know how long he/she will
> have to wait.

Yes and no.  It could also be 5 minutes.  Depends on the settings.  Also,
(assuming the author doesn't abandon the edit), after a successful Save, the
lock would automatically be release, so actually, a person would have to
wait zero minutes after the previous person finishes editing.

> Also, what happens if the original author takes longer than 10 minutes
> to edit a page and forgets to press Preview within the 10 minute time
> period?  Suddenly that author may discover that someone else has grabbed
> the lock.

Well, I guess that would be their tough luck, they should be more aware of
their edit time (which is why I suggest a simple javascript clock with a
countdown timer that's always in view).  More importantly though, how is
that any more or less inconvenient that taking 20 minutes to edit, then
saving, and finding out later that you
overwrote somebody elses recent edit (or perhaps never knowing that you
overwrote somebody elses interm edit)?

I think a page lock feature is a necessary thing (I voted 4).

> (Cookies are not a true solution here, because not all browsers or
programs
> used to edit wiki pages support cookies.)

I agree.  I was thinking about a different approach.  Upon a successful
lock/preview, PmWiki can pass from system Time (in seconds) to the edit form
as a hidden field (I think it's called epok time in geekspeak).  The number
is
unique, and will never be repeated (only increments).  So rather than
checking the $Author field, PmWiki would actually be checking for the "key"
.. that being, the time at which the file was originally locked.  Each time
the Preview button is hit, the
lock is extended by x minutes, and a new "key" is passed as a hidden form
field.  PmWiki could check the validity of the edit/author by checking that
the key passed in the edit form is the same key that is recorded in the file
lock.

> > You could go one step  further,  and  instead  of giving an error
message
> > during a page lock, you can say "Sorry, $Author is currently editing
that page.
> > Try again after x minutes".

> To me, all of this violates the spirit of PmWiki Philosophy #2, which
> is to make things as easy on authors as possible.

I don't see how allowing people to overwrite each others changes is
making it easy on authors.  It only makes it easy to create chaos.  I see
nothing wrong with denying one author access to edit a document while
granting another author the courtesy to finish editing their revision.

It's common courtesy, like when you go buy groceries in a supermarket, you
don't just have 2-3 people all throwing their groceries through the scanner
at the same
time.  Then you'd have those same 2-3 people sorting out the bill, not to
mention their groceries at the end.  I don't see this as being any
different.  Further ...

>  Since conflicts are relatively uncommon,

 .. it makes all that much more sense to me that authors should be
prevented from editing a document if somebody else is editing it. If it
doesn't happen that often, then the inconvenience to the secondary author
will be minimal compared to the inconvenience of the first author who could
have his edits compromised by somebody happening along to do a quick edit.

Anyways .. in the end, I think there will be strong arguments for both
sides.  So I guess the real question here is .. Can it be done?  Is there a
strong enough demand for it to be done?  And judging by the comments so far,
I'd say that it would have to be a "on" / "off" switch so admin's can choose
how they want conflicts to be handles.

Example:

$EnablePageLockConflictResolution = 1;
$PageLockTimeOut = 5;       // minutes

-Steven Leite




More information about the pmwiki-users mailing list