Not signed in (Sign In)

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

  1.  

    This question was edited both by Steve Huntsman and me. To me, it looked like he had edited my edit and made it worse, almost an act of vandalism. So I left a seminasty comment about it. But later, it has occurred to me that we were probably editing the question at the same time, and my edit just happened to arrive first. (And so Steve is blameless after all.)

    Is there no locking mechanism, or at least a way to warn a user that someone else edited the page? Or perhaps there is such a way, but subject to a race condition?

  2.  
    Wait, right now it is a race condition!
  3.  
    Golly...some sort of version control would be nice. I'd have to imagine this would have occurred to the folks at SE.
    • CommentAuthorAnweshi
    • CommentTimeMar 22nd 2010
     

    In electrical engineering you would use a clock and state changes are permitted only when the clock is changing. Thus race conditions are avoided.

    But I have no idea whatsoever, for a possible solution in AJAX connections. I am however hopeful it shouldn't be too complicated.

  4.  
    I thought that jSMath is not AJAX but something that loads into memory on every page (Isn't this the whole point of that new MathJax system?), but I'm not a programming guy, so I'm not sure.
    • CommentAuthorAnweshi
    • CommentTimeMar 22nd 2010
     

    @fpqc. The answering script uses AJAX. That is what I had in mind. When an answer is already posted while you are typing one, then it shows on the screen. This is done via AJAX.

    I was thinking that when more than one person is editing, some solution handled by AJAX could be useful.

  5.  
    It is trivial to make the current system show a small editing icon when you press "add comment" in case someone already started writing one.
    When you press to add a comment ajax is invoked to show newest comments. At the same time the server can store that you started editing a comment, and on the ajax return it can also say if someone started.
    Only technical consideration I can think of, that isn't too problematic, is after how many seconds of waiting on a user to post - but still hasn't - do you remove the cache variable saying he's editing. 60 seconds or so?
  6.  
    It would also be nice if we could see whether or not somebody is typing up a new comment, because there are often times when I have deleted comments to fix typos and accidentally screwed up the comments.
  7.  

    The original question is slightly different to simultaneously adding comments or answers. When editing a post, then that post ought to be locked so that no-one else can edit it (within some timelimit). That is nothing to do with AJAX or any javascript since the request to edit goes directly to the server as a regular request.

    The lock can, of course, be "soft" in that if you try to edit a locked question you get the response "X has been editing this question for N minutes, do you want to break the lock?". That's what the nLab software does.

  8.  

    It's well and good to get feedback that others are entering comments, but my question was about editing questions (and answers). I don't think it should be possible to lock a file for editing (someone might keep such a lock forever), but it certainly ought to be possible to get a warning if someone else is currently editing a post when you hit the edit button. But more importantly, if a someone else has posted an edit between the time you hit edit and the time you submit, the submit should not succeed, at least not without flashing red lights and a siren going off and the new “submit” button making it clear that you are about to overwrite someone else's work. Ideally, you should get to see the changes the other person did, plus your own editing buffer unchanged, and whatever tools will help you merge your own edit with the other person's. That last bit may be quite hard to do, but I think the loud warning is important.

  9.  
    Editing posts is rare, definitely after 10 minutes of up time.
    So really this isn't such a big thing.
    I vote for Andrew and nLab's solution. Especially if it's a standard others will recognize.
  10.  
    @HHO: you should roll back my edit. Or I will. I'll give you a head start before we race to do this!
  11.  

    @Steve: Done. I removed my comment as well.

  12.  

    This has been brought up at meta.SO.