Opened 16 years ago

Last modified 15 years ago

#3772 closed defect

Race condition in TicketRPC.update() — at Initial Version

Reported by: Michael Stone Owned by: Alec Thomas
Priority: highest Component: XmlRpcPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

There is a race between t.save_changes() and tn.notify() in TicketRPC.update() in tracrpc/ticket.py which can result in Trac sending notification emails with empty changelogs. I believe that this race can be fixed with the following simple patch:

Index: ticket.py
===================================================================
--- ticket.py   (revision 4311)
+++ ticket.py   (working copy)
@@ -102,7 +102,7 @@
         t = model.Ticket(self.env, id)
         for k, v in attributes.iteritems():
             t[k] = v
-        t.save_changes(req.authname or 'anonymous', comment)
+        t.save_changes(req.authname or 'anonymous', comment, when=now)
 
         if notify:
             try:

Change History (0)

Note: See TracTickets for help on using tickets.