Skip to content

Commit 2cd6332

Browse files
tobixenclaude
andcommitted
feat: add save-load.mutable feature replacing the old no_overwrite flag
Add 'save-load.mutable' to the FEATURES dict in compatibility_hints.py: it indicates that a calendar object resource can be modified and PUT back to the server (the server must reflect the change on the next GET/REPORT). Defaults to 'full' as virtually all servers support this; the check exists to surface rare exceptions like Google Calendar's legacy CalDAV API. Replace every use of the old 'no_overwrite' quirk flag in test_caldav.py with the new feature: skip_on_compatibility_flag("no_overwrite") → skip_unless_support("save-load.mutable") if not check_compatibility_flag("no_overwrite"): → if is_supported("save-load.mutable"): prompt: Create tests for a new feature checking if it's possible to overwrite a calendar event with new data. Should replace the old "overwrite" compatibility flag. (Perhaps this "incompatibility" was due to the caldav library not supporting etags and not updating from no sequence to SEQUENCE:1 ... i somehow doubt we'll find any servers not supporting this feature, but we should have the check anyway). load-save.mutable ? Update the compatibility_hints.py in /tmp/caldav-async-tests/ and update the tests there as well. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent eb2c079 commit 2cd6332

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

caldav/compatibility_hints.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,10 @@ class FeatureSet:
177177
"default": {"support": "full"},
178178
"links": ["https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.4.5"],
179179
},
180+
"save-load.mutable": {
181+
"description": "A saved calendar object resource can be modified and PUT back to the server; the server accepts the update and returns the modified data on the next GET/REPORT. When 'unsupported', the server treats calendar objects as immutable after initial creation (e.g. Google Calendar's legacy CalDAV API). Replaces the old 'no_overwrite' compatibility flag.",
182+
"default": {"support": "full"},
183+
},
180184
"search": {
181185
"description": "calendar MUST support searching for objects using the REPORT method, as specified in RFC4791, section 7",
182186
"links": ["https://datatracker.ietf.org/doc/html/rfc4791#section-7"],

tests/test_caldav.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ def testObjectBySyncToken(self):
21032103
assert len(list(my_changed_objects)) == 0
21042104

21052105
## I was unable to run the rest of the tests towards Google using their legacy caldav API
2106-
self.skip_on_compatibility_flag("no_overwrite")
2106+
self.skip_unless_support("save-load.mutable")
21072107

21082108
## MODIFYING an object
21092109
if is_time_based:
@@ -2234,7 +2234,7 @@ def testSync(self):
22342234
time.sleep(1)
22352235

22362236
## I was unable to run the rest of the tests towards Google using their legacy caldav API
2237-
self.skip_on_compatibility_flag("no_overwrite")
2237+
self.skip_unless_support("save-load.mutable")
22382238

22392239
## MODIFYING an object
22402240
obj.icalendar_instance.subcomponents[0]["SUMMARY"] = "foobar"
@@ -3701,7 +3701,7 @@ def testCreateOverwriteDeleteEvent(self):
37013701

37023702
## add same event again. As it has same uid, it should be overwritten
37033703
## (but some calendars may throw a "409 Conflict")
3704-
if not self.check_compatibility_flag("no_overwrite"):
3704+
if self.is_supported("save-load.mutable"):
37053705
e2 = c.add_event(ev1)
37063706
if todo_ok:
37073707
t2 = c.add_todo(todo)
@@ -3747,7 +3747,7 @@ def testCreateOverwriteDeleteEvent(self):
37473747
# Verify that we can't look it up, both by URL and by ID
37483748
with pytest.raises(self._notFound()):
37493749
c.event_by_url(e1.url)
3750-
if not self.check_compatibility_flag("no_overwrite"):
3750+
if self.is_supported("save-load.mutable"):
37513751
with pytest.raises(self._notFound()):
37523752
c.event_by_url(e2.url)
37533753
if not self.check_compatibility_flag("event_by_url_is_broken"):
@@ -3804,7 +3804,7 @@ def testDateSearchAndFreeBusy(self):
38043804
## (But events should not be immutable! One should be able to change an event, push the changes
38053805
## out to all participants and all copies of the calendar, and let everyone know that it's a
38063806
## changed event and not a cancellation and a new event).
3807-
self.skip_on_compatibility_flag("no_overwrite")
3807+
self.skip_unless_support("save-load.mutable")
38083808

38093809
# ev2 is same UID, but one year ahead.
38103810
# The timestamp should change.

0 commit comments

Comments
 (0)