[CalendarServer-changes] [10206] CalendarServer/branches/release/CalendarServer-4.3-dev/txdav/common /datastore/sql_legacy.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Jan 4 16:32:01 PST 2013


Revision: 10206
          http://trac.calendarserver.org//changeset/10206
Author:   glyph at apple.com
Date:     2013-01-04 16:32:01 -0800 (Fri, 04 Jan 2013)
Log Message:
-----------
If a missing invite UID is found, remove the offending bind row, rather than blowing up the request with an exception.

Modified Paths:
--------------
    CalendarServer/branches/release/CalendarServer-4.3-dev/txdav/common/datastore/sql_legacy.py

Modified: CalendarServer/branches/release/CalendarServer-4.3-dev/txdav/common/datastore/sql_legacy.py
===================================================================
--- CalendarServer/branches/release/CalendarServer-4.3-dev/txdav/common/datastore/sql_legacy.py	2013-01-05 00:03:05 UTC (rev 10205)
+++ CalendarServer/branches/release/CalendarServer-4.3-dev/txdav/common/datastore/sql_legacy.py	2013-01-05 00:32:01 UTC (rev 10206)
@@ -543,10 +543,23 @@
             localname = resourceName
             if bindMode != _BIND_MODE_DIRECT:
                 sharetype = 'I'
-                [[shareuid]] = yield self._inviteUIDByResourceIDsQuery.on(
+                expectUID = yield self._inviteUIDByResourceIDsQuery.on(
                     self._txn, resourceID=resourceID,
                     homeID=self._home._resourceID
                 )
+                if len(expectUID) != 1:
+                    # This was a split task collection, leaving an orphaned bind
+                    # row behind.  Let's ignore it and drop it so it won't get
+                    # picked up in the future; the user can re-share if they
+                    # intended to share both calendar event and reminders.
+                    bind = self._bindSchema
+                    yield Delete(
+                        From=bind,
+                        Where=(bind.RESOURCE_ID == resourceID)
+                          .And(bind.HOME_RESOURCE_ID == self._home._resourceID)
+                    ).on(self._txn)
+                    continue
+                [[shareuid]] = expectUID
             else:
                 sharetype = 'D'
                 shareuid = "Direct-%s-%s" % (self._home._resourceID, resourceID,)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130104/2226532d/attachment.html>


More information about the calendarserver-changes mailing list