[CalendarServer-changes] [15689] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 22 14:30:33 PDT 2016


Revision: 15689
          http://trac.calendarserver.org//changeset/15689
Author:   sagen at apple.com
Date:     2016-06-22 14:30:32 -0700 (Wed, 22 Jun 2016)
Log Message:
-----------
Make all of the ServerInfo config feed into the config portion of the sync-token as well

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/config.py
    CalendarServer/trunk/twistedcaldav/stdconfig.py
    CalendarServer/trunk/twistedcaldav/test/test_config.py

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2016-06-21 21:55:03 UTC (rev 15688)
+++ CalendarServer/trunk/twistedcaldav/config.py	2016-06-22 21:30:32 UTC (rev 15689)
@@ -344,7 +344,7 @@
         Iterates the previously registered keys (sorted, so the order in which
         the keys were registered doesn't affect the hash) and generates an MD5
         hash of the combined values.  The hash is cached, and is invalidated
-        during a reload or if invalidateSyncToken is called.o
+        during a reload or if invalidateSyncToken is called.
 
         @return: the sync token
         @rtype: C{str}

Modified: CalendarServer/trunk/twistedcaldav/stdconfig.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/stdconfig.py	2016-06-21 21:55:03 UTC (rev 15688)
+++ CalendarServer/trunk/twistedcaldav/stdconfig.py	2016-06-22 21:30:32 UTC (rev 15689)
@@ -1767,7 +1767,11 @@
         configDict.ServerInfo,
         configDict.ServerInfoToken) = buildServerInfo(configDict)
 
+    # Make all the ServerInfo config feed into the config portion of the sync
+    # token as well:
+    config.addSyncTokenKey("ServerInfoToken")
 
+
 PRE_UPDATE_HOOKS = (
     _preUpdateDirectoryService,
     _preUpdateResourceService,

Modified: CalendarServer/trunk/twistedcaldav/test/test_config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_config.py	2016-06-21 21:55:03 UTC (rev 15688)
+++ CalendarServer/trunk/twistedcaldav/test/test_config.py	2016-06-22 21:30:32 UTC (rev 15689)
@@ -718,6 +718,14 @@
     def testSyncToken(self):
         config.load(self.testConfig)
 
+        self.assertEquals(
+            sorted(config._syncTokenKeys),
+            ['Notifications.Services.APNS.CalDAV.Topic',
+             'Notifications.Services.APNS.CardDAV.Topic',
+             'Notifications.Services.APNS.Enabled',
+             'ServerInfoToken']
+        )
+
         # no sync token keys specified; need to empty this array here because
         # stdconfig is registering keys automatically
         config._syncTokenKeys = []
@@ -744,4 +752,4 @@
 
         # reload automatically invalidates
         config.reload()
-        self.assertEquals("a1c46c5aff1899658dac033ee8520b07", config.syncToken())
+        self.assertEquals(config._cachedSyncToken, None)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20160622/da406f6b/attachment.html>


More information about the calendarserver-changes mailing list