• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7700 for generic doc work for TWiki-6.0.2. Use View topic Item7703 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

I have actually for the first time tried to work on the same topic at the same time from two different machines and logged in as two different user names.

And that was a disappointing experience. Half the time I try the behavour is like Cairo. Ie. the last one that saves overwrite what the other user just saved so it gets lost.

Test case I do.

  • Test User A edits the test topic and starts writing
  • Test User B edits same topic. He is met with a warning and clicks edit anyway
  • Test User B saves his changed
  • Test User A saves

In 3 out of 10 cases where I tried the changes made by User B is lost.

Ie. the feature cannot be trusted at all.

This bug holds back 4.0.2 release! Marked as Requirement!


Can you be more specific please? What were the 10 testcases? Edit form? Edit text? Topic with/without form? Which testcases fail? Thanks.


Normal plain test topic. I did not try 10 different test cases. Maybe it is a language thing.

I tested on the same topic trying the same thing 10 times in a row. And it failed 3 out of 10.


Did you try yourself?


Running with the debug code change for UI/Save.pm suggested by CC on #twiki.

I have reproduced the error twice and I have placed the resulting error log on a special topic on the TWiki4 test server.



I have a breakthrough in the tracing but not a fix or root cause.

The debug code use looks like this.

    my $merged;
    # assumes rev numbers start at 1
    if ( $originalrev ) {
        my ( $date, $author, $rev ) = $newMeta->getRevisionInfo();
        print STDERR $user->stringify() . " is saving modified $originalrev over $rev by " . $author->stringify() . "\n";
        # If the last save was by me, don't merge
        if ( $rev ne $originalrev && !$author->equals( $user )) {
            print STDERR "Merging\n";
            my ( $ancestorMeta, $ancestorText ) =
              $store->readTopic( undef, $webName, $topic, $originalrev );
            $newText = TWiki::Merge3::merge(
                $ancestorText, $prevText, $newText,
                $originalrev, $rev, "new",
                '\r?\n' );
            if( $formDef && $prevMeta ) {
                $newMeta->merge( $prevMeta, $formDef );
            $merged = [ $originalrev, $author->wikiName(), $rev ];
        } else {
            print STDERR "No merge\n";

And I have this case where I can reproduce the error each and every time.

It appeared to be random but it is not.

I have browser/user A. He is called TestUser.

And I have browser/user B. He is called KennethLavrsen

Finally I have a test topic called SimultaneousEdit

  • A views SimultaneousEdit
  • B views SimultaneousEdit

  • A hits the EDIT button.
  • A saves the SimultaneousEdit topic
  • B hits the EDIT button.
  • A hits the EDIT button
  • A is met with a warning that B is editing. A hits "EDIT ANYWAY"
  • A saves the SimultaneousEdit
  • B saves the SimultaneousEdit. B is now supposed to get the warning that his changes are merged with the changes made by A. But instead the changes made by B are saved and A's changed are dropped.

The error log when things go wrong

[Sat Mar 18 16:59:06 2006] [error] [client] TestUser/Main.TestUser is saving modified 67 over 67 by TestUser/Main.TestUser, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit?t=1142697536
[Sat Mar 18 16:59:06 2006] [error] [client] No merge, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit?t=1142697536
[Sat Mar 18 16:59:17 2006] [error] [client] ********************************, referer: http://merlin.lavrsen.dk/twiki/bin/view/Sandbox/SimultaneousEdit
[Sat Mar 18 16:59:17 2006] [error] [client] OopsException(leaseconflict/lease_active web=>Sandbox topic=>SimultaneousEdit keep=>1 params=>[Main.KennethLavrsen,4 seconds,59 minutes 56 seconds]), referer: http://merlin.lavrsen.dk/twiki/bin/view/Sandbox/SimultaneousEdit
[Sat Mar 18 16:59:17 2006] [error] [client] ********************************, referer: http://merlin.lavrsen.dk/twiki/bin/view/Sandbox/SimultaneousEdit
[Sat Mar 18 16:59:23 2006] [error] [client] TestUser/Main.TestUser is saving modified 67 over 67 by TestUser/Main.TestUser, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit
[Sat Mar 18 16:59:23 2006] [error] [client] No merge, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit
[Sat Mar 18 16:59:30 2006] [error] [client] KennethLavrsen/Main.KennethLavrsen is saving modified 67 over 67 by TestUser/Main.TestUser, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit?t=1142697293
[Sat Mar 18 16:59:30 2006] [error] [client] No merge, referer: http://merlin.lavrsen.dk/twiki/bin/edit/Sandbox/SimultaneousEdit?t=1142697293

Additionally to the error - when the sequence of events is different and the merge does happen the user is met with the wrong numbers for the revision it is saving.

  • A is editing
  • B is now editing also
  • B saves rev 74
  • A is now saving what becomes 75. But the text in the merge dialog says this

Topic was merged. Rev 73 was saved by KennethLavrsen, while you were still editing. Those changes have been merged with yours to create Rev 74. Text fields will have ....

It should say that rev 74 was saved and ... to crease Rev 75.

Maybe the getting these numbers wrong is also what causes the nasty error above.


OK, I'm pretty sure I understand this now. it is due to the "replace revision if edited again within" technology. What happens is this:

  1. User A edits topic
  2. User A saves rev N
  3. User B edits topic, picks up rev N
  4. User A edits topic again, picks up rev N
  5. User A saves changes; save sees that the change is within the ReplceIfEditiedWithin window, so does not increment the rev number
  6. User B saves, code sees that the rev number on disc has not changed since they started editing so doesn't detect a need to merge.
Clearly revision numbers cannot be trusted.

The workaround is to disable the {ReplaceifEditedWithin} functionality.

On the wierd numbers; you oscillate between "User A", "User B" and "Kenneth Lavrsen". Are you User A or User B? Presumably User B? Either way, this is a separate issue.


Ouch, that was tough.

In the end I stored a new value in the TOPICINFO, called "reprev", whenever a reprev happens. This field stores the rev number when a reprev happens, so it can be ignored if the real rev number increments, but if it is the same as the version you know the topic was repreved. If another save sees the field is set and has used the same original rev, it does a merge2 instead of a merge3.

This whole business of re-using rev numbers is bad news.

SVN 9387


Removed Merge3.pm from MANIFEST.

SVN 9415.

-- SP

Closed with the release of 4.0.2


Summary Simultaneous edit feature is not at all reliable.
ReportedBy TWiki:Main.KennethLavrsen

SVN Range Mon, 13 Mar 2006 build 9258
AppliesTo Engine

Priority Urgent
CurrentState Closed

Checkins 10175 10771 11390 9352 9387 9415
TargetRelease patch
Edit | Attach | Watch | Print version | History: r17 < r16 < r15 < r14 < r13 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r17 - 2006-04-01 - KennethLavrsen
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback