Trac generates empty diff when description changes from \n line endings to \r\n line endings
|Reported by:||Owned by:|
We have a system that uses the XMLRPC API to create tickets. This system was creating description fields with the body having \n new lines. The first time some human did a comment in the system we where getting a "description changed" message.
After digging into trac's db with
select oldvalue,newvalue from ticket_change where ticket=XXX and field='description';
'newvalue' had \r\n as newlines.
Therefore I came to the conclusion trac itself was modifying the content of the field.
We noticed two things not working properly.
- Trac's email notifier was sending out the diffs, but since they where newlines it was a huge diff with nothing really happening.
- Trac's webUI diff was NOT showing any changes at (https://mytrac.com/ticket/XXX?action=diff&version=X)
I believe these behaviors should be the opposite, email notifier should ignore differences in line endings while the webui should point out they are the same except for the line endings.