Title: [commits] (morgen) [15290] Fix for bug 10715 (Chandler tries to remove already removed item), r=Jeffrey
Revision
15290
Author
morgen
Date
2007-08-30 13:35:35 -0700 (Thu, 30 Aug 2007)

Log Message

Fix for bug 10715 (Chandler tries to remove already removed item), r=Jeffrey

Modified Paths

Diff

Modified: trunk/chandler/parcels/osaf/sharing/recordset_conduit.py (15289 => 15290)

--- trunk/chandler/parcels/osaf/sharing/recordset_conduit.py	2007-08-30 03:15:15 UTC (rev 15289)
+++ trunk/chandler/parcels/osaf/sharing/recordset_conduit.py	2007-08-30 20:35:35 UTC (rev 15290)
@@ -589,6 +589,8 @@
 
             elif receive and pending and item is not None:
 
+                import pdb; pdb.set_trace()
+
                 state.autoResolve(rsInternal, dApply, dSend)
 
             if uuid:
@@ -892,7 +894,14 @@
                 (item not in self.share.contents and
                  alias not in remotelyRemoved)):
                 if send:
-                    if not state.isNew():
+
+                    if state.pendingRemoval:
+                        # It's already been deleted on the server
+                        doLog("Item with pending removal also removed locally: %s", alias)
+                        if alias in toSend:
+                            del toSend[alias]
+
+                    elif not state.isNew():
                         # Only send a removal for a state that isn't new
                         toSend[alias] = None
                         doLog("Remotely removing item: %s", alias)

Modified: trunk/chandler/parcels/osaf/sharing/tests/round_trip.py (15289 => 15290)

--- trunk/chandler/parcels/osaf/sharing/tests/round_trip.py	2007-08-30 03:15:15 UTC (rev 15289)
+++ trunk/chandler/parcels/osaf/sharing/tests/round_trip.py	2007-08-30 20:35:35 UTC (rev 15290)
@@ -1791,4 +1791,32 @@
         self.assert_(not sharing.hasConflicts(item))
 
 
+
+
+
+        # Regression test for bug 10715 (moving item with pending removal to
+        # trash)
+        item0 = pim.Note(itsView=view0)
+        self.share0.contents.add(item0)
+        view0.commit(); stats = self.share0.sync(); view0.commit()
+        view1.commit(); stats = self.share1.sync(); view1.commit()
+        item1 = view1.findUUID(item0.itsUUID)
+        item1.delete()
+        item0.displayName = "Changed"
+        view1.commit(); stats = self.share1.sync(); view1.commit()
+        view0.commit(); stats = self.share0.sync(); view0.commit()
+        self.assert_(sharing.hasConflicts(item0)) # pending removal conflict
+        self.share0.contents.remove(item0)
+        view0.commit(); stats = self.share0.sync(); view0.commit()
+        self.assert_(checkStats(stats,
+            ({'added' : 0, 'modified' : 0, 'removed' : 0},
+             {'added' : 0, 'modified' : 0, 'removed' : 0})),
+            "Sync operation mismatch")
+
+
+
+
+
+
+
         self.share0.destroy() # clean up




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to