<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[13373] CalendarServer/trunk/txdav</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.calendarserver.org//changeset/13373">13373</a></dd>
<dt>Author</dt> <dd>gaya@apple.com</dd>
<dt>Date</dt> <dd>2014-04-25 15:43:49 -0700 (Fri, 25 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>don't reconcile group attendees for old events when group changes</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcaldavdatastoresqlpy">CalendarServer/trunk/txdav/caldav/datastore/sql.py</a></li>
<li><a href="#CalendarServertrunktxdavwhotesttest_group_attendeespy">CalendarServer/trunk/txdav/who/test/test_group_attendees.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcaldavdatastoresqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/sql.py (13372 => 13373)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/sql.py        2014-04-25 15:15:25 UTC (rev 13372)
+++ CalendarServer/trunk/txdav/caldav/datastore/sql.py        2014-04-25 22:43:49 UTC (rev 13373)
</span><span class="lines">@@ -1974,10 +1974,33 @@
</span><span class="cx">         update schema.GROUP_ATTENDEE
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         if groupCUAToAttendeeMemberPropMap is None:
</span><del>-            if not hasattr(self, &quot;_groupCUAToAttendeeMemberPropMap&quot;):
</del><ins>+            # post processing.
+
+            # see if this event ends in the past
+            tr = schema.TIME_RANGE
+            rows = yield Select(
+                [Count(tr.CALENDAR_OBJECT_RESOURCE_ID)],
+                From=tr,
+                Where=(
+                    tr.CALENDAR_OBJECT_RESOURCE_ID == self._resourceID).And(
+                    tr.END_DATE &gt; datetime.datetime.utcnow()
+                ),
+            ).on(self._txn)
+
+            if rows[0][0] == 0:
+                # delete group attendee rows and exit
+                ga = schema.GROUP_ATTENDEE
+                rows = yield Delete(
+                    From=ga,
+                    Where=ga.RESOURCE_ID == self._resourceID,
+                    Return=[ga.GROUP_ID]
+                ).on(self._txn)
+                returnValue(bool(rows))
+
+            if hasattr(self, &quot;_groupCUAToAttendeeMemberPropMap&quot;):
+                    groupCUAToAttendeeMemberPropMap = self._groupCUAToAttendeeMemberPropMap
+            else:
</ins><span class="cx">                 returnValue(False)
</span><del>-            else:
-                groupCUAToAttendeeMemberPropMap = self._groupCUAToAttendeeMemberPropMap
</del><span class="cx"> 
</span><span class="cx">         changed = False
</span><span class="cx">         ga = schema.GROUP_ATTENDEE
</span><span class="lines">@@ -2696,7 +2719,7 @@
</span><span class="cx"> 
</span><span class="cx">         yield self.updateDatabase(component, inserting=inserting)
</span><span class="cx"> 
</span><del>-        # update GROUP_ATTENNDEE rows using
</del><ins>+        # update GROUP_ATTENDEE table rows
</ins><span class="cx">         yield self.updateGROUP_ATTENDEE()
</span><span class="cx"> 
</span><span class="cx">         # Post process managed attachments
</span></span></pre></div>
<a id="CalendarServertrunktxdavwhotesttest_group_attendeespy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/who/test/test_group_attendees.py (13372 => 13373)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/who/test/test_group_attendees.py        2014-04-25 15:15:25 UTC (rev 13372)
+++ CalendarServer/trunk/txdav/who/test/test_group_attendees.py        2014-04-25 22:43:49 UTC (rev 13373)
</span><span class="lines">@@ -23,7 +23,7 @@
</span><span class="cx"> from twisted.internet.defer import inlineCallbacks, returnValue
</span><span class="cx"> from twisted.trial import unittest
</span><span class="cx"> from twistedcaldav.config import config
</span><del>-from twistedcaldav.ical import Component, normalize_iCalStr
</del><ins>+from twistedcaldav.ical import Component, normalize_iCalStr, ignoredComponents
</ins><span class="cx"> from txdav.caldav.datastore.test.util import buildCalendarStore, populateCalendarsFrom, CommonCommonTests
</span><span class="cx"> from txdav.who.directory import CalendarDirectoryRecordMixin
</span><span class="cx"> from txdav.who.groups import GroupCacher
</span><span class="lines">@@ -94,9 +94,25 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     def _assertICalStrEqual(self, iCalStr1, iCalStr2):
</span><ins>+
+        def orderMemberValues(event):
+
+            for component in event.subcomponents():
+                if component.name() in ignoredComponents:
+                    continue
+
+                # remove all values and add them again
+                # this is sort of a hack, better pycalendar has ordering
+                for attendeeProp in tuple(component.properties(&quot;ATTENDEE&quot;)):
+                    if attendeeProp.hasParameter(&quot;MEMBER&quot;):
+                        parameterValues = tuple(attendeeProp.parameterValues(&quot;MEMBER&quot;))
+                        for paramterValue in parameterValues:
+                            attendeeProp.removeParameterValue(&quot;MEMBER&quot;, paramterValue)
+                        attendeeProp.setParameter(&quot;MEMBER&quot;, sorted(parameterValues))
+
</ins><span class="cx">         self.assertEqual(
</span><del>-            normalize_iCalStr(iCalStr1),
-            normalize_iCalStr(Component.fromString(iCalStr2)),
</del><ins>+            orderMemberValues(Component.fromString(normalize_iCalStr(iCalStr1))),
+            orderMemberValues(Component.fromString(normalize_iCalStr(iCalStr2)))
</ins><span class="cx">         )
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -147,13 +163,13 @@
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 0)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 0)
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar2, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -200,13 +216,13 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self.assertEqual(normalize_iCalStr(vcalendar2), normalize_iCalStr(data_get_1))
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_1))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -251,13 +267,13 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> &quot;&quot;&quot;
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar1 = yield cobj1.component()
-        self.assertEqual(normalize_iCalStr(vcalendar1), normalize_iCalStr(data_get_1))
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_1))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="lines">@@ -312,13 +328,13 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar2, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -380,13 +396,13 @@
</span><span class="cx"> END:VEVENT
</span><span class="cx"> END:VCALENDAR&quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar2, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -397,8 +413,9 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_groupChange(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        Test that group attendee changes are applied to existing resources.
</del><ins>+        Test that group attendee are changed when the group changes.
</ins><span class="cx">         &quot;&quot;&quot;
</span><ins>+
</ins><span class="cx">         data_put_1 = &quot;&quot;&quot;BEGIN:VCALENDAR
</span><span class="cx"> CALSCALE:GREGORIAN
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="lines">@@ -406,7 +423,7 @@
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> DTSTAMP:20051222T205953Z
</span><span class="cx"> CREATED:20060101T150000Z
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> SUMMARY:event 1
</span><span class="cx"> UID:event1@ninevah.local
</span><span class="lines">@@ -422,7 +439,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000002
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -439,7 +456,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000002
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -458,7 +475,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000002
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -483,54 +500,52 @@
</span><span class="cx">         self.assertEqual(len(wps), 0)
</span><span class="cx"> 
</span><span class="cx">         calendar = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
-        vcalendar2 = yield cobj1.component()
-        self.assertEqual(normalize_iCalStr(vcalendar2), normalize_iCalStr(data_get_2))
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_2))
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000001&quot;, 0)
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         self.patch(CalendarDirectoryRecordMixin, &quot;expandedMembers&quot;, unpatchedExpandedMembers)
</span><span class="cx"> 
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
-        vcalendar3 = yield cobj1.component()
-        self.assertEqual(normalize_iCalStr(vcalendar3), normalize_iCalStr(data_get_3))
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_3))
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000001&quot;, 1)
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         self.patch(CalendarDirectoryRecordMixin, &quot;expandedMembers&quot;, expandedMembers)
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
-        vcalendar3 = yield cobj1.component()
-        self.assertEqual(normalize_iCalStr(vcalendar3), normalize_iCalStr(data_get_4))
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_4))
</ins><span class="cx"> 
</span><del>-        cal1 = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        cobjs = yield cal1.objectResources()
</del><ins>+        cal = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        cobjs = yield cal.objectResources()
</ins><span class="cx">         self.assertEqual(len(cobjs), 1)
</span><del>-        comp1 = yield cobjs[0].componentForUser()
-        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp1))
</del><ins>+        comp = yield cobjs[0].componentForUser()
+        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_multieventGroupChange(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        Test that every event associated with a group chagnes when the group changes
</del><ins>+        Test that every event associated with a group changes when the group changes
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         data_put_1 = &quot;&quot;&quot;BEGIN:VCALENDAR
</span><span class="lines">@@ -540,7 +555,7 @@
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> DTSTAMP:20051222T205953Z
</span><span class="cx"> CREATED:20060101T150000Z
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> SUMMARY:event {0}
</span><span class="cx"> UID:event{0}@ninevah.local
</span><span class="lines">@@ -556,7 +571,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event{0}@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 0{0};EMAIL=user0{0}@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-00000000000{0}
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -573,7 +588,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event{0}@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 0{0};EMAIL=user0{0}@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-00000000000{0}
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -592,7 +607,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event{0}@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 0{0};EMAIL=user0{0}@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-00000000000{0}
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -620,20 +635,19 @@
</span><span class="cx"> 
</span><span class="cx">         for i in userRange:
</span><span class="cx">             calendar = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
</span><del>-            vcalendar1 = Component.fromString(data_put_1.format(i))
-            yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+            vcalendar = Component.fromString(data_put_1.format(i))
+            yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">             yield self.commit()
</span><span class="cx"> 
</span><del>-            cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
-            vcalendar2 = yield cobj1.component()
-            self.assertEqual(normalize_iCalStr(vcalendar2), normalize_iCalStr(data_get_2.format(i)))
</del><ins>+            cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
+            vcalendar = yield cobj.component()
+            self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_2.format(i)))
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000001&quot;, 0)
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         self.patch(CalendarDirectoryRecordMixin, &quot;expandedMembers&quot;, unpatchedExpandedMembers)
</span><span class="cx"> 
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(len(wps), len(userRange))
</span><span class="lines">@@ -641,15 +655,14 @@
</span><span class="cx">             yield wp.whenExecuted()
</span><span class="cx"> 
</span><span class="cx">         for i in userRange:
</span><del>-            cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
-            vcalendar3 = yield cobj1.component()
-            self.assertEqual(normalize_iCalStr(vcalendar3), normalize_iCalStr(data_get_3.format(i)))
</del><ins>+            cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
+            vcalendar = yield cobj.component()
+            self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_3.format(i)))
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000001&quot;, len(userRange))
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         self.patch(CalendarDirectoryRecordMixin, &quot;expandedMembers&quot;, expandedMembers)
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(len(wps), len(userRange))
</span><span class="lines">@@ -657,19 +670,132 @@
</span><span class="cx">             yield wp.whenExecuted()
</span><span class="cx"> 
</span><span class="cx">         for i in userRange:
</span><del>-            cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
-            vcalendar3 = yield cobj1.component()
-            self.assertEqual(normalize_iCalStr(vcalendar3), normalize_iCalStr(data_get_4.format(i)))
</del><ins>+            cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-00000000000{0}&quot;.format(i))
+            vcalendar = yield cobj.component()
+            self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_4.format(i)))
</ins><span class="cx"> 
</span><del>-        cal1 = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        cobjs = yield cal1.objectResources()
</del><ins>+        cal = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        cobjs = yield cal.objectResources()
</ins><span class="cx">         self.assertEqual(len(cobjs), len(userRange))
</span><span class="cx">         for cobj in cobjs:
</span><del>-            comp1 = yield cobj.componentForUser()
-            self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp1))
</del><ins>+            comp = yield cobj.componentForUser()
+            self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp))
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx">     @inlineCallbacks
</span><ins>+    def test_groupChangeOldEvent(self):
+        &quot;&quot;&quot;
+        Test that group attendee changes not applied to old events
+        &quot;&quot;&quot;
+
+        data_put_1 = &quot;&quot;&quot;BEGIN:VCALENDAR
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+VERSION:2.0
+BEGIN:VEVENT
+DTSTAMP:20051222T205953Z
+CREATED:20060101T150000Z
+DTSTART;TZID=US/Eastern:20240101T100000
+DURATION:PT1H
+SUMMARY:event 1
+UID:event1@ninevah.local
+ORGANIZER:MAILTO:user02@example.com
+ATTENDEE:mailto:user02@example.com
+ATTENDEE:MAILTO:group01@example.com
+END:VEVENT
+END:VCALENDAR&quot;&quot;&quot;
+
+        data_put_2 = &quot;&quot;&quot;BEGIN:VCALENDAR
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+VERSION:2.0
+BEGIN:VEVENT
+DTSTAMP:20051222T205953Z
+CREATED:20060101T150000Z
+DTSTART;TZID=US/Eastern:20140101T100000
+DURATION:PT1H
+SUMMARY:event 1
+UID:event1@ninevah.local
+ORGANIZER:MAILTO:user02@example.com
+ATTENDEE:mailto:user02@example.com
+ATTENDEE:MAILTO:group01@example.com
+END:VEVENT
+END:VCALENDAR&quot;&quot;&quot;
+
+        data_get_1 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+BEGIN:VEVENT
+UID:event1@ninevah.local
+DTSTART;TZID=US/Eastern:20240101T100000
+DURATION:PT1H
+ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000002
+ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
+ATTENDEE;CN=User 01;EMAIL=user01@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000001&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000001
+CREATED:20060101T150000Z
+ORGANIZER;CN=User 02;EMAIL=user02@example.com:urn:x-uid:10000000-0000-0000-0000-000000000002
+SUMMARY:event 1
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+        data_get_2 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+CALSCALE:GREGORIAN
+PRODID:-//Example Inc.//Example Calendar//EN
+BEGIN:VEVENT
+UID:event1@ninevah.local
+DTSTART;TZID=US/Eastern:20140101T100000
+DURATION:PT1H
+ATTENDEE;CN=User 02;EMAIL=user02@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000002
+ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
+CREATED:20060101T150000Z
+ORGANIZER;CN=User 02;EMAIL=user02@example.com:urn:x-uid:10000000-0000-0000-0000-000000000002
+SEQUENCE:1
+SUMMARY:event 1
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+        @inlineCallbacks
+        def expandedMembers(self, records=None):
+            yield None
+            returnValue(set())
+
+        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
+
+        calendar = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
+        yield self.commit()
+
+        wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
+        yield self.commit()
+        self.assertEqual(len(wps), 1)
+        yield wps[0].whenExecuted()
+
+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_1))
+
+        yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000001&quot;, 1)
+
+        vcalendar = Component.fromString(data_put_2)
+        yield cobj.setComponent(vcalendar)
+        yield self.commit()
+
+        self.patch(CalendarDirectoryRecordMixin, &quot;expandedMembers&quot;, expandedMembers)
+
+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000002&quot;)
+        vcalendar = yield cobj.component()
+        self.assertEqual(normalize_iCalStr(vcalendar), normalize_iCalStr(data_get_2))
+
+        wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000001&quot;)
+        self.assertEqual(len(wps), 0)
+
+
+    @inlineCallbacks
</ins><span class="cx">     def test_groupRemovalFromDirectory(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><span class="cx">         Test that removing a group from the directory also removes the expanded attendees.
</span><span class="lines">@@ -692,7 +818,7 @@
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> DTSTAMP:20051222T205953Z
</span><span class="cx"> CREATED:20060101T150000Z
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> SUMMARY:event 1
</span><span class="cx"> UID:event1@ninevah.local
</span><span class="lines">@@ -710,7 +836,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -732,7 +858,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="lines">@@ -755,16 +881,16 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 01;CUTYPE=GROUP;EMAIL=group01@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 02;CUTYPE=GROUP;EMAIL=group02@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000002
</span><span class="cx"> ATTENDEE;CN=Group 03;CUTYPE=GROUP;EMAIL=group03@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000003
</span><ins>+ATTENDEE;CN=User 06;EMAIL=user06@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000002&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000006
</ins><span class="cx"> ATTENDEE;CN=User 07;EMAIL=user07@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000002&quot;,&quot;urn:x-uid:20000000-0000-0000-0000-000000000003&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000007
</span><span class="cx"> ATTENDEE;CN=User 08;EMAIL=user08@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000002&quot;,&quot;urn:x-uid:20000000-0000-0000-0000-000000000003&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000008
</span><span class="cx"> ATTENDEE;CN=User 09;EMAIL=user09@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000003&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000009
</span><del>-ATTENDEE;CN=User 06;EMAIL=user06@example.com;MEMBER=&quot;urn:x-uid:20000000-0000-0000-0000-000000000002&quot;;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;SCHEDULE-STATUS=1.2:urn:x-uid:10000000-0000-0000-0000-000000000006
</del><span class="cx"> CREATED:20060101T150000Z
</span><span class="cx"> ORGANIZER;CN=User 01;EMAIL=user01@example.com:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> SEQUENCE:2
</span><span class="lines">@@ -783,13 +909,13 @@
</span><span class="cx">                 result = yield unpatchedRecordWithUID(self, uid)
</span><span class="cx">             returnValue(result)
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar2, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -803,48 +929,46 @@
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar3 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar3, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         # remove group  run cacher again
</span><span class="cx">         self.patch(DirectoryService, &quot;recordWithUID&quot;, recordWithUID)
</span><span class="cx"> 
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000002&quot;)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar4 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar4, data_get_2)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_2)
</ins><span class="cx"> 
</span><del>-        cal1 = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000006&quot;)
-        cobjs = yield cal1.objectResources()
</del><ins>+        cal = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000006&quot;)
+        cobjs = yield cal.objectResources()
</ins><span class="cx">         self.assertEqual(len(cobjs), 1)
</span><del>-        comp1 = yield cobjs[0].componentForUser()
-        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp1))
</del><ins>+        comp = yield cobjs[0].componentForUser()
+        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp))
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         # add group back, run cacher
</span><span class="cx">         self.patch(DirectoryService, &quot;recordWithUID&quot;, unpatchedRecordWithUID)
</span><span class="cx"> 
</span><del>-        groupCacher = GroupCacher(self.transactionUnderTest().directoryService())
</del><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000002&quot;)
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield self.commit()
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar5 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar5, data_get_3)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_3)
</ins><span class="cx"> 
</span><del>-        cal1 = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000006&quot;)
-        cobjs = yield cal1.objectResources()
</del><ins>+        cal = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000006&quot;)
+        cobjs = yield cal.objectResources()
</ins><span class="cx">         self.assertEqual(len(cobjs), 1)
</span><del>-        comp1 = yield cobjs[0].componentForUser()
-        self.assertFalse(&quot;STATUS:CANCELLED&quot; in str(comp1))
</del><ins>+        comp = yield cobjs[0].componentForUser()
+        self.assertFalse(&quot;STATUS:CANCELLED&quot; in str(comp))
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -871,7 +995,7 @@
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> DTSTAMP:20051222T205953Z
</span><span class="cx"> CREATED:20060101T150000Z
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> SUMMARY:event 1
</span><span class="cx"> UID:event1@ninevah.local
</span><span class="lines">@@ -888,7 +1012,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 02;CUTYPE=GROUP;EMAIL=group02@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000002
</span><span class="lines">@@ -910,7 +1034,7 @@
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> DTSTAMP:20051222T205953Z
</span><span class="cx"> CREATED:20060101T150000Z
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> SUMMARY:event 1
</span><span class="cx"> UID:event1@ninevah.local
</span><span class="lines">@@ -926,7 +1050,7 @@
</span><span class="cx"> PRODID:-//Example Inc.//Example Calendar//EN
</span><span class="cx"> BEGIN:VEVENT
</span><span class="cx"> UID:event1@ninevah.local
</span><del>-DTSTART;TZID=US/Eastern:20140101T100000
</del><ins>+DTSTART;TZID=US/Eastern:20240101T100000
</ins><span class="cx"> DURATION:PT1H
</span><span class="cx"> ATTENDEE;CN=User 01;EMAIL=user01@example.com;RSVP=TRUE:urn:x-uid:10000000-0000-0000-0000-000000000001
</span><span class="cx"> ATTENDEE;CN=Group 02;CUTYPE=GROUP;EMAIL=group02@example.com;RSVP=TRUE;SCHEDULE-STATUS=3.7:urn:x-uid:20000000-0000-0000-0000-000000000002
</span><span class="lines">@@ -941,13 +1065,13 @@
</span><span class="cx"> END:VCALENDAR
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> 
</span><del>-        vcalendar1 = Component.fromString(data_put_1)
-        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar1)
</del><ins>+        vcalendar = Component.fromString(data_put_1)
+        yield calendar.createCalendarObjectWithName(&quot;data1.ics&quot;, vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar2 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar2, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -965,17 +1089,17 @@
</span><span class="cx">         self.assertEqual(len(wps), 1)
</span><span class="cx">         yield wps[0].whenExecuted()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar3 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar3, data_get_1)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_1)
</ins><span class="cx"> 
</span><del>-        vcalendar4 = Component.fromString(data_put_2)
-        yield cobj1.setComponent(vcalendar4)
</del><ins>+        vcalendar = Component.fromString(data_put_2)
+        yield cobj.setComponent(vcalendar)
</ins><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><del>-        cobj1 = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
-        vcalendar5 = yield cobj1.component()
-        self._assertICalStrEqual(vcalendar5, data_get_2)
</del><ins>+        cobj = yield self.calendarObjectUnderTest(name=&quot;data1.ics&quot;, calendar_name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000001&quot;)
+        vcalendar = yield cobj.component()
+        self._assertICalStrEqual(vcalendar, data_get_2)
</ins><span class="cx"> 
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000006&quot;, 1)
</span><span class="cx">         yield self._verifyObjectResourceCount(&quot;10000000-0000-0000-0000-000000000007&quot;, 1)
</span><span class="lines">@@ -988,9 +1112,9 @@
</span><span class="cx">         wps = yield groupCacher.refreshGroup(self.transactionUnderTest(), &quot;20000000-0000-0000-0000-000000000003&quot;)
</span><span class="cx">         self.assertEqual(len(wps), 0)
</span><span class="cx"> 
</span><del>-        cal1 = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000009&quot;)
-        cobjs = yield cal1.objectResources()
</del><ins>+        cal = yield self.calendarUnderTest(name=&quot;calendar&quot;, home=&quot;10000000-0000-0000-0000-000000000009&quot;)
+        cobjs = yield cal.objectResources()
</ins><span class="cx">         self.assertEqual(len(cobjs), 1)
</span><del>-        comp1 = yield cobjs[0].componentForUser()
-        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp1))
</del><ins>+        comp = yield cobjs[0].componentForUser()
+        self.assertTrue(&quot;STATUS:CANCELLED&quot; in str(comp))
</ins><span class="cx">         yield self.commit()
</span></span></pre>
</div>
</div>

</body>
</html>