Bug: Del and Ins Tags After Topic Save
After topic save, text is all messed up with
<ins> and
<del> tags.
This happened on two separate topics with the latest DEVELOP, r3590 to r3592.
Test case
I do not know how to reproduce, but here is text before and after save:
Before: (newlines added for readability)
---+ Summary Tests
Link to WebNotify, link to 'web.topic' TWiki.WebHome, simple variable %WIKIUSERNAME%, no
p-escaped var %<nop>TOC%, var with param %URLPARAM{ "test" default="empty"}%. Lorem ipsu
m dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labo
re et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco la
boris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cu
pidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
---++ $summary(nohead)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(noh
ead)" }%
---++ $summary(expandvar)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(exp
andvar)" }%
---++ $summary(showvarnames)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(sho
wvarnames)" }%
-- Main.PeterThoeny - 04 Feb 2005
After save: (newlines added for readability)
---+ Summary Tests
<del><del><del><del>Link to WebNotify, link to web,topic TWiki.WebHome, simple variable
%WIKIUSERNAME%, nop-escaped var %<nop>TOC%, var with param %URLPARAM{ "test" default="em
pty"}%. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exerc
itation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor i
n reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteu
r sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim i
d est laborum.</del><ins>Link to WebNotify, link to 'web.topic' TWiki.WebHome, simple va
riable %WIKIUSERNAME%, nop-escaped var %<nop>TOC%, var with param %URLPARAM{ "test" defa
ult="empty"}%. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostru
d exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. E
xcepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit
anim id est laborum.</ins></del><ins>Link to WebNotify, link to 'web.topic' TWiki.WebHo
me, simple variable %WIKIUSERNAME%, nop-escaped var %<nop>TOC%, var with param %URLPARAM
{ "test" default="empty"}%. Lorem ipsum dolor sit amet, consectetur adipisicing elit, se
d do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam
, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Dui
s aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat null
a pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia de
serunt mollit anim id est laborum.</ins></del><ins>Link to WebNotify, link to 'web.topic
' TWiki.WebHome, simple variable %WIKIUSERNAME%, nop-escaped var %<nop>TOC%, var with pa
ram %URLPARAM{ "test" default="empty"}%. Lorem ipsum dolor sit amet, consectetur adipisi
cing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo c
onsequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore e
u fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa q
ui officia deserunt mollit anim id est laborum.</ins></del><ins>Link to WebNotify, link
to 'web.topic' TWiki.WebHome, simple variable %WIKIUSERNAME%, nop-escaped var %<nop>TOC%
, var with param %URLPARAM{ "test" default="empty"}%. Lorem ipsum dolor sit amet, consec
tetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqu
a. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex
ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse ci
llum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, su
nt in culpa qui officia deserunt mollit anim id est laborum.</ins>
---++ $summary(nohead)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(noh
ead)" }%
---++ $summary(expandvar)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(exp
andvar)" }%
---++ $summary(showvarnames)
%SEARCH{ "%TOPIC%" scope="topic" nosearch="on" nototal="on" format="$topic: $summary(sho
wvarnames)" }%
-- Main.PeterThoeny - 04 Feb 2005
Environment
--
PeterThoeny - 04 Feb 2005
Impact and Available Solutions
Follow up
Fix record
Discussion
i've seen this happen once before but i've been unable to recreate it.
which branch (MAIN or DEVELOP?)
--
WillNorris - 07 Feb 2005
this is starting to occur more frequently to me now---seems to be related to cr/lf issues? continuing investigating...
--
WillNorris - 08 Feb 2005
sven mentions that perhaps it is cdot's merge does on topics that exist but don't have an ,v fle
--
WillNorris - 08 Feb 2005
It should only happen if there has been a parallel edit by someone else of the same topic. It uses diff to find the differences and ins and del tags to highlight them. The diffrence algorithm is supposed to ignore whitespace, maybe I got that wrong?
--
CrawfordCurrie - 08 Feb 2005
i found it again - it happened to me when I created a new web, and then edited the
WebHome topic (i removed all the existing content, and replaced it with one small sentence)
--
SvenDowideit - 08 Feb 2005
Hmmm; I wonder, could it be because lock files are left lying around? It should only happen if the head rev is not the rev you started editing on.
The code that does the business is at line 173 in TWiki/UI/Save.pm, BTW:
# assumes rev numbers start at 1
if ( $originalrev ) {
my ( $date, $author, $rev ) = $newMeta->getRevisionInfo();
if ( $rev ne $originalrev ) {
$newText = TWiki::Merge::merge( $currText, $newText, "\\r?\\n" );
$newMeta->merge( $currMeta );
}
}
Anyone see what's wrong with that?
--
CrawfordCurrie - 09 Feb 2005
I think I just twigged what's wrong - well, at least one case. If I edit, and then save, but instead of checkpointing I just use "back" to get back to the edit, and then save again, the original rev is now 2 behind the latest saved rev, so it will try to do a merge.
The only solution I can think of is to not do a merge if the most recent rev was saved by the current user. i.e.
# If the last save was by me, don't merge even if the rev is different
if ( $rev ne $originalrev && !$author->equals( $user )) {
That could lead to problems in an environment where everyone is
TWikiGuest, as merges would never happen. But I suspect that is a small price to pay.
--
CrawfordCurrie - 17 Feb 2005
I haven't had any reports of this re-emerging, so I'm marking it done.
--
CrawfordCurrie - 03 Mar 2005