Skip to content

Commit aa848a0

Browse files
committed
chore: remove unique_calendar_ids
the unique_calendar_ids old compatibility flag seems not to be needed anymore by any servers I test.
1 parent 7db7b4b commit aa848a0

2 files changed

Lines changed: 20 additions & 53 deletions

File tree

caldav/compatibility_hints.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class FeatureSet:
7777
## TODO: in the future, templates for the principal URL, calendar URLs etc may also be added.
7878
}
7979
},
80+
"url": {
81+
"type": "client-hints",
82+
},
8083
"get-current-user-principal": {
8184
"description": "Support for RFC5397, current principal extension. Most CalDAV servers have this, but it is an extension to the DAV standard. Possibly observed missing on mail.ru, DavMail gateway and it is possible to configure the support in some sabre-based servers",
8285
"links": ["https://datatracker.ietf.org/doc/html/rfc5397"],
@@ -859,9 +862,6 @@ def dotted_feature_set_list(self, compact=False):
859862
'vtodo-cannot-be-uncompleted':
860863
"""If a VTODO object has been set with STATUS:COMPLETE, it's not possible to delete the COMPLTEDED attribute and change back to STATUS:IN-ACTION""",
861864

862-
'unique_calendar_ids':
863-
"""For every test, generate a new and unique calendar id""",
864-
865865
'sticky_events':
866866
"""Events should be deleted before the calendar is deleted, """
867867
"""and/or deleting a calendar may not have immediate effect""",
@@ -965,7 +965,6 @@ def dotted_feature_set_list(self, compact=False):
965965
'principal-search.by-name.self': {'support': 'unsupported'},
966966
'principal-search': {'support': 'ungraceful'},
967967
'search.time-range.open.start.duration': 'broken',
968-
#'old_flags': ['unique_calendar_ids'],
969968
## I'm surprised, I'm quite sure this was passing earlier. Caldav commit a98d50490b872e9b9d8e93e2e401c936ad193003, caldav server checker commit 3cae24cf99da1702b851b5a74a9b88c8e5317dad
970969
'search.combined-is-logical-and': False,
971970
## Observed with Nextcloud 33: server delivers iTIP notification to the inbox AND
@@ -997,7 +996,9 @@ def dotted_feature_set_list(self, compact=False):
997996
zimbra = {
998997
'auto-connect.url': {'basepath': '/dav/'},
999998
'delete-calendar': {'support': 'fragile', 'behaviour': 'may move to trashbin instead of deleting immediately'},
1000-
'save-load.get-by-url': {'support': 'fragile', 'behaviour': '404 most of the time - but sometimes 200. Weird, should be investigated more'},
999+
## This is a zimbra bug when creating calendars with a display
1000+
## name. Now mitigated in the calendar creation code.
1001+
#'save-load.get-by-url': {'support': 'fragile', 'behaviour': '404 most of the time - but sometimes 200. Weird, should be investigated more'},
10011002
## Zimbra treats same-UID events across calendars as aliases of the same event
10021003
'save.duplicate-uid.cross-calendar': {'support': 'unsupported'},
10031004
'search.recurrences.expanded.exception': {'support': 'unsupported'}, ## TODO: verify
@@ -1160,7 +1161,6 @@ def dotted_feature_set_list(self, compact=False):
11601161

11611162
## See comments on https://github.com/python-caldav/caldav/issues/3
11621163
#icloud = [
1163-
# 'unique_calendar_ids',
11641164
# 'duplicate_in_other_calendar_with_same_uid_breaks',
11651165
# 'sticky_events',
11661166
# 'no_journal', ## it threw a 500 internal server error!

tests/test_caldav.py

Lines changed: 14 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,12 +1322,8 @@ def setup_method(self):
13221322
for flag in self.old_features:
13231323
assert flag in incompatibility_description
13241324

1325-
if self.check_compatibility_flag("unique_calendar_ids"):
1326-
self.testcal_id = "testcalendar-" + str(uuid.uuid4())
1327-
self.testcal_id2 = "testcalendar-" + str(uuid.uuid4())
1328-
else:
1329-
self.testcal_id = "pythoncaldav-test"
1330-
self.testcal_id2 = "pythoncaldav-test2"
1325+
self.testcal_id = "pythoncaldav-test"
1326+
self.testcal_id2 = "pythoncaldav-test2"
13311327

13321328
foo = self.is_supported("rate-limit", dict)
13331329
if foo.get("enable"):
@@ -1408,8 +1404,6 @@ def _cleanup(self, mode=None):
14081404
pass
14091405
else:
14101406
cal.delete()
1411-
if self.check_compatibility_flag("unique_calendar_ids") and mode == "pre":
1412-
a = self._teardownCalendar(name="Yep")
14131407
for calid in (self.testcal_id, self.testcal_id2, self.testcal_id + "-tasks"):
14141408
self._teardownCalendar(cal_id=calid)
14151409
if self.cleanup_regime == "thorough":
@@ -1471,10 +1465,7 @@ def _fixCalendar_(self, **kwargs):
14711465

14721466
# Pre-processing: set up defaults for name and cal_id
14731467
if "name" not in kwargs:
1474-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
1475-
"light",
1476-
"pre",
1477-
):
1468+
if self.cleanup_regime in ("light", "pre"):
14781469
self._teardownCalendar(cal_id=self.testcal_id)
14791470
if not self.is_supported("create-calendar.set-displayname"):
14801471
kwargs["name"] = None
@@ -2291,10 +2282,7 @@ def testSync(self):
22912282
def testLoadEvent(self):
22922283
self.skip_unless_support("save-load.event")
22932284
self.skip_unless_support("create-calendar")
2294-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
2295-
"light",
2296-
"pre",
2297-
):
2285+
if self.cleanup_regime in ("light", "pre"):
22982286
self._teardownCalendar(cal_id=self.testcal_id)
22992287
self._teardownCalendar(cal_id=self.testcal_id2)
23002288
c1 = self._fixCalendar(name="Yep", cal_id=self.testcal_id)
@@ -2307,20 +2295,14 @@ def testLoadEvent(self):
23072295
if not self.check_compatibility_flag("event_by_url_is_broken"):
23082296
assert e1.url == e1_.url
23092297
e1.load()
2310-
if (
2311-
not self.check_compatibility_flag("unique_calendar_ids")
2312-
and self.cleanup_regime == "post"
2313-
):
2298+
if self.cleanup_regime == "post":
23142299
self._teardownCalendar(cal_id=self.testcal_id)
23152300
self._teardownCalendar(cal_id=self.testcal_id2)
23162301

23172302
def testCopyEvent(self):
23182303
self.skip_unless_support("save-load.event")
23192304
self.skip_unless_support("create-calendar")
2320-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
2321-
"light",
2322-
"pre",
2323-
):
2305+
if self.cleanup_regime in ("light", "pre"):
23242306
self._teardownCalendar(cal_id=self.testcal_id)
23252307
self._teardownCalendar(cal_id=self.testcal_id2)
23262308

@@ -2366,10 +2348,7 @@ def testCopyEvent(self):
23662348
else:
23672349
assert len(c1.get_events()) == 2
23682350

2369-
if (
2370-
not self.check_compatibility_flag("unique_calendar_ids")
2371-
and self.cleanup_regime == "post"
2372-
):
2351+
if self.cleanup_regime == "post":
23732352
self._teardownCalendar(cal_id=self.testcal_id)
23742353
self._teardownCalendar(cal_id=self.testcal_id2)
23752354

@@ -3496,10 +3475,7 @@ def testUtf8Event(self):
34963475
# TODO: split up in creating a calendar with non-ascii name
34973476
# and an event with non-ascii description
34983477
self.skip_unless_support("create-calendar")
3499-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
3500-
"light",
3501-
"pre",
3502-
):
3478+
if self.cleanup_regime in ("light", "pre"):
35033479
self._teardownCalendar(cal_id=self.testcal_id)
35043480

35053481
c = self._fixCalendar(name="Yølp", cal_id=self.testcal_id)
@@ -3519,19 +3495,13 @@ def testUtf8Event(self):
35193495
if "zimbra" not in str(c.url):
35203496
assert len(events) == 1
35213497

3522-
if (
3523-
not self.check_compatibility_flag("unique_calendar_ids")
3524-
and self.cleanup_regime == "post"
3525-
):
3498+
if self.cleanup_regime == "post":
35263499
self._teardownCalendar(cal_id=self.testcal_id)
35273500

35283501
def testUnicodeEvent(self):
35293502
self.skip_unless_support("save-load.event")
35303503
self.skip_unless_support("create-calendar")
3531-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
3532-
"light",
3533-
"pre",
3534-
):
3504+
if self.cleanup_regime in ("light", "pre"):
35353505
self._teardownCalendar(cal_id=self.testcal_id)
35363506
c = self._fixCalendar(name="Yølp", cal_id=self.testcal_id)
35373507

@@ -3565,18 +3535,15 @@ def testSetCalendarProperties(self):
35653535

35663536
# Creating a new calendar with different ID but with existing name
35673537
# TODO: why do we do this?
3568-
if not self.check_compatibility_flag("unique_calendar_ids") and self.cleanup_regime in (
3569-
"light",
3570-
"pre",
3571-
):
3538+
# TODO: we're doing this all over the placee, it should be consolidated
3539+
# TODO: it should be in the test setup/teardown
3540+
if self.cleanup_regime in ("light", "pre"):
35723541
self._teardownCalendar(cal_id=self.testcal_id2)
35733542
cc = self._fixCalendar(name="Yep", cal_id=self.testcal_id2)
35743543
try:
35753544
cc.delete()
35763545
except error.DeleteError:
3577-
if not self.is_supported("delete-calendar") or self.check_compatibility_flag(
3578-
"unique_calendar_ids"
3579-
):
3546+
if not self.is_supported("delete-calendar"):
35803547
raise
35813548

35823549
c.set_properties(

0 commit comments

Comments
 (0)