#2805: Ticket view sometimes silently drops information
--------------------------------+-------------------------------------------
 Reporter:  [EMAIL PROTECTED]  |        Owner:  jonas
     Type:  defect              |       Status:  new  
 Priority:  high                |    Milestone:  0.10 
Component:  ticket system       |      Version:  devel
 Severity:  major               |   Resolution:       
 Keywords:                      |  
--------------------------------+-------------------------------------------
Old description:

> I've got a Ticket with a changelog (as returned by get_changelog) that
> looks like this:
>
> [(1139910447,
>   'miro',
>   'comment',
>   '',
>   '<long important comment snipped>'),
>  (1139910447, 'miro', 'comment', '', ''),
>  (1139910447, 'miro', 'attachment', '', 'sshserver.py')]
>
> The 1st 'comment' entry comes from an actual comment on the ticket.  The
> 2nd 'comment' entry comes from the description of the attachment on the
> attachment table - ie, it is a row returned by the final SELECT clause in
> the statement which retrieves the changelog (line ~288 in
> trac/ticket/model.py).  Since the timestamp and author on these two rows
> are the same, when the web ui builds up the change data set for the
> rendering pass (line ~420 in trac/ticket/web_ui.py), it does not create a
> new `changes' entry, but merely overwrites the first comment with the
> second.
>
> It seems as though the schema is missing a reliable way to associate
> multiple pieces of change information with each other.  The ad hoc
> time/author mechanism cannot be counted on to work in all cases.
>
> I've patched my local version of trac like this in order to temporarily
> work around the problem:
>
> {{{
> === trac/ticket/web_ui.py
> ==================================================================
> --- trac/ticket/web_ui.py       (revision 2048)
> +++ trac/ticket/web_ui.py       (local)
> @@ -418,7 +418,7 @@
>          curr_date   = 0
>          changes = []
>          for date, author, field, old, new in changelog:
> -            if date != curr_date or author != curr_author:
> +            if date != curr_date or author != curr_author or (field in
> changes[-1]):
>                  changes.append({
>                      'date': util.format_datetime(date),
>                      'author': author,
> }}}

New description:

 I've got a Ticket with a changelog (as returned by get_changelog) that
 looks like this:

 {{{
 [(1139910447,
   'miro',
   'comment',
   '',
   '<long important comment snipped>'),
  (1139910447, 'miro', 'comment', '', ''),
  (1139910447, 'miro', 'attachment', '', 'sshserver.py')]
 }}}

 The 1st 'comment' entry comes from an actual comment on the ticket.  The
 2nd 'comment' entry comes from the description of the attachment on the
 attachment table - ie, it is a row returned by the final SELECT clause in
 the statement which retrieves the changelog (line ~288 in
 trac/ticket/model.py).  Since the timestamp and author on these two rows
 are the same, when the web ui builds up the change data set for the
 rendering pass (line ~420 in trac/ticket/web_ui.py), it does not create a
 new `changes' entry, but merely overwrites the first comment with the
 second.

 It seems as though the schema is missing a reliable way to associate
 multiple pieces of change information with each other.  The ad hoc
 time/author mechanism cannot be counted on to work in all cases.

 I've patched my local version of trac like this in order to temporarily
 work around the problem:

 {{{
 === trac/ticket/web_ui.py
 ==================================================================
 --- trac/ticket/web_ui.py       (revision 2048)
 +++ trac/ticket/web_ui.py       (local)
 @@ -418,7 +418,7 @@
          curr_date   = 0
          changes = []
          for date, author, field, old, new in changelog:
 -            if date != curr_date or author != curr_author:
 +            if date != curr_date or author != curr_author or (field in
 changes[-1]):
                  changes.append({
                      'date': util.format_datetime(date),
                      'author': author,
 }}}

-- 
Ticket URL: <http://projects.edgewall.com/trac/ticket/2805>
The Trac Project <http://trac.edgewall.com/>
_______________________________________________
Trac-Tickets mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac-tickets

Reply via email to