<!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>[13931] CalendarServer/trunk/txdav/caldav/datastore</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/13931">13931</a></dd>
<dt>Author</dt> <dd>cdaboo@apple.com</dd>
<dt>Date</dt> <dd>2014-09-02 11:56:19 -0700 (Tue, 02 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make sure free busy updates properly when overridden instances are added/removed from an auto-accept attendee.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingicaldiffpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingprocessingpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/processing.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoreschedulingtesttest_icaldiffpy">CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_icaldiff.py</a></li>
<li><a href="#CalendarServertrunktxdavcaldavdatastoretesttest_sqlpy">CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingicaldiffpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py (13930 => 13931)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py        2014-09-02 18:53:50 UTC (rev 13930)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/icaldiff.py        2014-09-02 18:56:19 UTC (rev 13931)
</span><span class="lines">@@ -770,16 +770,28 @@
</span><span class="cx"> 
</span><span class="cx">         # Now verify that each additional component in oldset matches a derived component in newset
</span><span class="cx">         for key in oldset - newset:
</span><ins>+            rid = key[2]
</ins><span class="cx">             oldcomponent = oldmap[key]
</span><del>-            newcomponent = self.newcalendar.deriveInstance(key[2])
</del><ins>+            newcomponent = self.newcalendar.deriveInstance(rid)
</ins><span class="cx">             if newcomponent is None:
</span><ins>+                # For the non iTIP case we must report missing components on either side. Marking
+                # the DTSTART as changed is enough to trigger logic in the caller to treat this
+                # as a significant change.
+                if not isiTip:
+                    rids[rid.getText() if rid is not None else &quot;&quot;] = {&quot;DTSTART&quot;: set()}
</ins><span class="cx">                 continue
</span><span class="cx">             self._diffComponents(oldcomponent, newcomponent, rids, isiTip)
</span><span class="cx"> 
</span><span class="cx">         # Now verify that each additional component in oldset matches a derived component in newset
</span><span class="cx">         for key in newset - oldset:
</span><del>-            oldcomponent = self.oldcalendar.deriveInstance(key[2])
</del><ins>+            rid = key[2]
+            oldcomponent = self.oldcalendar.deriveInstance(rid)
</ins><span class="cx">             if oldcomponent is None:
</span><ins>+                # For the non iTIP case we must report missing components on either side. Marking
+                # the DTSTART as changed is enough to trigger logic in the caller to treat this
+                # as a significant change.
+                if not isiTip:
+                    rids[rid.getText() if rid is not None else &quot;&quot;] = {&quot;DTSTART&quot;: set()}
</ins><span class="cx">                 continue
</span><span class="cx">             newcomponent = newmap[key]
</span><span class="cx">             self._diffComponents(oldcomponent, newcomponent, rids, isiTip)
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingprocessingpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/processing.py (13930 => 13931)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/processing.py        2014-09-02 18:53:50 UTC (rev 13930)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/processing.py        2014-09-02 18:56:19 UTC (rev 13931)
</span><span class="lines">@@ -43,7 +43,6 @@
</span><span class="cx"> import hashlib
</span><span class="cx"> import json
</span><span class="cx"> import uuid
</span><del>-import time
</del><span class="cx"> 
</span><span class="cx"> &quot;&quot;&quot;
</span><span class="cx"> CalDAV implicit processing.
</span><span class="lines">@@ -755,9 +754,7 @@
</span><span class="cx">                             end=str(makeTimedUTC(instance.end)),
</span><span class="cx">                         )
</span><span class="cx"> 
</span><del>-                        t = time.time()
</del><span class="cx">                         yield generateFreeBusyInfo(testcal, fbinfo, tr, 0, uid, servertoserver=True, accountingItems=accounting if len(instances) == 1 else None)
</span><del>-                        print time.time() - t
</del><span class="cx"> 
</span><span class="cx">                         # If any fbinfo entries exist we have an overlap
</span><span class="cx">                         if len(fbinfo[0]) or len(fbinfo[1]) or len(fbinfo[2]):
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoreschedulingtesttest_icaldiffpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_icaldiff.py (13930 => 13931)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_icaldiff.py        2014-09-02 18:53:50 UTC (rev 13930)
+++ CalendarServer/trunk/txdav/caldav/datastore/scheduling/test/test_icaldiff.py        2014-09-02 18:56:19 UTC (rev 13931)
</span><span class="lines">@@ -4520,13 +4520,164 @@
</span><span class="cx">             ),
</span><span class="cx">         )
</span><span class="cx"> 
</span><del>-        for description, calendar1, calendar2, rids in itertools.chain(data1, data2, data3,):
</del><ins>+        data4 = (
+            (
+                &quot;#4.1 Override component removed&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080602T120000Z
+DTSTART:20080602T130000Z
+DTEND:20080602T140000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                {},
+            ),
+            (
+                &quot;#4.2 Override component added&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080602T120000Z
+DTSTART:20080602T130000Z
+DTEND:20080602T140000Z
+SUMMARY:Test
+END:VCALENDAR
+&quot;&quot;&quot;,
+                {},
+            ),
+        )
+
+        data5 = (
+            (
+                &quot;#5.1 Override component removed&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080602T120000Z
+DTSTART:20080602T130000Z
+DTEND:20080602T140000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                {&quot;20080602T120000Z&quot;: {&quot;DTSTART&quot;: set()}},
+            ),
+            (
+                &quot;#5.2 Override component added&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080601T120000Z
+DTSTART:20080601T120000Z
+DTEND:20080601T130000Z
+SUMMARY:Test
+END:VEVENT
+BEGIN:VEVENT
+UID:12345-67890
+RECURRENCE-ID:20080602T120000Z
+DTSTART:20080602T130000Z
+DTEND:20080602T140000Z
+SUMMARY:Test
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;,
+                {&quot;20080602T120000Z&quot;: {&quot;DTSTART&quot;: set()}},
+            ),
+        )
+
+        for description, calendar1, calendar2, rids in itertools.chain(data1, data2, data3, data4,):
</ins><span class="cx">             differ = iCalDiff(Component.fromString(calendar1), Component.fromString(calendar2), False)
</span><span class="cx">             got_rids = differ.whatIsDifferent()
</span><span class="cx">             rids = dict([(DateTime.parseText(k) if k else None, v) for k, v in rids.items()])
</span><span class="cx">             self.assertEqual(got_rids, rids, msg=&quot;%s expected R-IDs: '%s', got: '%s'&quot; % (description, rids, got_rids,))
</span><span class="cx"> 
</span><ins>+        for description, calendar1, calendar2, rids in itertools.chain(data5,):
+            differ = iCalDiff(Component.fromString(calendar1), Component.fromString(calendar2), False)
+            got_rids = differ.whatIsDifferent(isiTip=False)
+            self.assertEqual(got_rids, rids, msg=&quot;%s expected R-IDs: '%s', got: '%s'&quot; % (description, rids, got_rids,))
</ins><span class="cx"> 
</span><ins>+
</ins><span class="cx">     def test_attendee_needs_action(self):
</span><span class="cx"> 
</span><span class="cx">         data = (
</span></span></pre></div>
<a id="CalendarServertrunktxdavcaldavdatastoretesttest_sqlpy"></a>
<div class="modfile"><h4>Modified: CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py (13930 => 13931)</h4>
<pre class="diff"><span>
<span class="info">--- CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py        2014-09-02 18:53:50 UTC (rev 13930)
+++ CalendarServer/trunk/txdav/caldav/datastore/test/test_sql.py        2014-09-02 18:56:19 UTC (rev 13931)
</span><span class="lines">@@ -7003,7 +7003,7 @@
</span><span class="cx"> 
</span><span class="cx"> class TimeRangeUpdateOptimization(CommonCommonTests, unittest.TestCase):
</span><span class="cx">     &quot;&quot;&quot;
</span><del>-    CalendarObject splitting tests
</del><ins>+    CalendarObject time range optimization tests.
</ins><span class="cx">     &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">     EVENT1 = &quot;&quot;&quot;BEGIN:VCALENDAR
</span><span class="lines">@@ -7174,13 +7174,17 @@
</span><span class="cx"> 
</span><span class="cx">         self.now = DateTime.getNowUTC()
</span><span class="cx">         self.now.setDateOnly(True)
</span><ins>+        self.now1 = self.now.duplicate()
+        self.now1.offsetDay(1)
+        self.now2 = self.now.duplicate()
+        self.now2.offsetDay(2)
</ins><span class="cx"> 
</span><span class="cx">         self.trcount = 0
</span><span class="cx">         base_addInstances = CalendarObject._addInstances
</span><del>-        def __addInstances(*args):
</del><ins>+        def _addInstances(*args):
</ins><span class="cx">             self.trcount += 1
</span><span class="cx">             return base_addInstances(*args)
</span><del>-        self.patch(CalendarObject, &quot;_addInstances&quot;, __addInstances)
</del><ins>+        self.patch(CalendarObject, &quot;_addInstances&quot;, _addInstances)
</ins><span class="cx"> 
</span><span class="cx">         self.patch(config, &quot;FreeBusyIndexDelayedExpand&quot;, False)
</span><span class="cx">         self.patch(config, &quot;FreeBusyIndexSmartUpdate&quot;, True)
</span><span class="lines">@@ -7489,7 +7493,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_schedulingPUT(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        Test that second PUT withe time change causes a TIME_RANGE update
</del><ins>+        Test that second PUT with time change causes a TIME_RANGE update
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         # Need schedule-q off for this test
</span><span class="lines">@@ -7529,7 +7533,7 @@
</span><span class="cx">     @inlineCallbacks
</span><span class="cx">     def test_schedulingPUT_withoutOptimization(self):
</span><span class="cx">         &quot;&quot;&quot;
</span><del>-        Test that second PUT withe time change causes a TIME_RANGE update
</del><ins>+        Test that second PUT with time change causes a TIME_RANGE update
</ins><span class="cx">         &quot;&quot;&quot;
</span><span class="cx"> 
</span><span class="cx">         self.patch(config, &quot;FreeBusyIndexSmartUpdate&quot;, False)
</span><span class="lines">@@ -7566,3 +7570,189 @@
</span><span class="cx">         yield self.commit()
</span><span class="cx"> 
</span><span class="cx">         self.assertEqual(self.trcount, 11)
</span><ins>+
+
+    INVITE_OVERRIDE1 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+CALSCALE:GREGORIAN
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+DTSTART:{now}T120000Z
+DURATION:PT1H
+SUMMARY:New Event
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+RRULE:FREQ=DAILY
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now1}T120000Z
+DTSTART:{now1}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now1
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:urn:x-uid:75EA36BE-F71B-40F9-81F9-CF59BF40CA8F
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+    INVITE_OVERRIDE2 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+CALSCALE:GREGORIAN
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now1}T120000Z
+DTSTART:{now1}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now1
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:urn:x-uid:75EA36BE-F71B-40F9-81F9-CF59BF40CA8F
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+    INVITE_OVERRIDE3 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+CALSCALE:GREGORIAN
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+DTSTART:{now}T120000Z
+DURATION:PT1H
+SUMMARY:New Event
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+RRULE:FREQ=DAILY
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now1}T120000Z
+DTSTART:{now1}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now1
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:urn:x-uid:75EA36BE-F71B-40F9-81F9-CF59BF40CA8F
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now2}T120000Z
+DTSTART:{now2}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now2
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+ATTENDEE;PARTSTAT=NEEDS-ACTION:urn:x-uid:75EA36BE-F71B-40F9-81F9-CF59BF40CA8F
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+    INVITE_OVERRIDE4 = &quot;&quot;&quot;BEGIN:VCALENDAR
+VERSION:2.0
+PRODID:-//CALENDARSERVER.ORG//NONSGML Version 1//EN
+CALSCALE:GREGORIAN
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+DTSTART:{now}T120000Z
+DURATION:PT1H
+SUMMARY:New Event
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+RRULE:FREQ=DAILY
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now1}T120000Z
+DTSTART:{now1}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now1
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+END:VEVENT
+BEGIN:VEVENT
+CREATED:20100203T013849Z
+UID:uid1
+RECURRENCE-ID:{now2}T120000Z
+DTSTART:{now2}T120000Z
+DURATION:PT1H
+SUMMARY:New Event now2
+DTSTAMP:20100203T013909Z
+ORGANIZER:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:mailto:user01@example.com
+ATTENDEE;PARTSTAT=ACCEPTED:urn:x-uid:75EA36BE-F71B-40F9-81F9-CF59BF40CA8F
+END:VEVENT
+END:VCALENDAR
+&quot;&quot;&quot;
+
+
+    @inlineCallbacks
+    def test_schedulingPUT_AddRemoveOverride_AutoAccept(self):
+        &quot;&quot;&quot;
+        Test that second PUT with override change causes a TIME_RANGE update
+        &quot;&quot;&quot;
+
+        # Need schedule-q off for this test
+        self.patch(config.Scheduling.Options.WorkQueues, &quot;Enabled&quot;, False)
+        self.patch(config.Scheduling.Options.WorkQueues, &quot;AutoReplyDelaySeconds&quot;, 1)
+
+        # First PUT causes T-R change
+        cal = yield self.calendarUnderTest(home=&quot;user01&quot;, name=&quot;calendar&quot;)
+        yield cal.createObjectResourceWithName(&quot;1.ics&quot;, Component.fromString(self.INVITE_OVERRIDE1.format(
+            now=self.now.getText(),
+            now1=self.now1.getText(),
+            now2=self.now2.getText(),
+        )))
+        yield self.commit()
+
+        # Wait for it to complete
+        yield JobItem.waitEmpty(self._sqlCalendarStore.newTransaction, reactor, 60)
+
+        self.assertEqual(self.trcount, 3)
+
+        # Organizer adds attendee to override causes T-R change (except for their item)
+        cobj = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;)
+        yield cobj.setComponent(Component.fromString(self.INVITE_OVERRIDE3.format(
+            now=self.now.getText(),
+            now1=self.now1.getText(),
+            now2=self.now2.getText(),
+        )))
+        yield self.commit()
+
+        # Wait for it to complete
+        yield JobItem.waitEmpty(self._sqlCalendarStore.newTransaction, reactor, 60)
+
+        self.assertEqual(self.trcount, 5)
+
+        # Organizer removes attendee from override causes T-R change (except for their item)
+        cobj = yield self.calendarObjectUnderTest(home=&quot;user01&quot;, calendar_name=&quot;calendar&quot;)
+        yield cobj.setComponent(Component.fromString(self.INVITE_OVERRIDE4.format(
+            now=self.now.getText(),
+            now1=self.now1.getText(),
+            now2=self.now2.getText(),
+        )))
+        yield self.commit()
+
+        # Wait for it to complete
+        yield JobItem.waitEmpty(self._sqlCalendarStore.newTransaction, reactor, 60)
+
+        self.assertEqual(self.trcount, 6)
</ins></span></pre>
</div>
</div>

</body>
</html>