jspricke / radicale-remind

Radicale storage backends for Remind and Abook
GNU General Public License v3.0
41 stars 4 forks source link

Server error on MacOSX iCalendar #27

Closed capocasa closed 1 year ago

capocasa commented 1 year ago

Getting a bunch of these errors when using iCalendar on MacOS on a recent M1 macbook air notebook computer. The issue does not appear when editing the same calendar on an iPhone 11. It also works fine on DavX5 on my Android phone.

It would appear that only iCalendar os MacOSX uses the PROPPATCH request method to store some kinds of properties that other calendars don't.

Most likely this is because the get_meta class methods are overridden and implemented both in the MinCollection and Collection classes in radicale_remind.py, but not set_meta.

This is radicale_remind 0.5.0 on Python 3.9 on a Debian bullseye system. Happy to help any way I can.

Oct 07 16:37:07 martin env[45098]: [2023-10-07 16:37:07 +0200] [45098/Thread-171] [ERROR] An exception occurred during PROPPATCH request on '/myUser/myCalendar/':
Oct 07 16:37:07 martin env[45098]: Traceback (most recent call last):
Oct 07 16:37:07 martin env[45098]:   File "/home/myUser/.local/lib/python3.9/site-packages/radicale/app/__init__.py", line 105, in __call__
Oct 07 16:37:07 martin env[45098]:     status_text, headers, answers = self._handle_request(environ)
Oct 07 16:37:07 martin env[45098]:   File "/home/myUser/.local/lib/python3.9/site-packages/radicale/app/__init__.py", line 287, in _handle_request
Oct 07 16:37:07 martin env[45098]:     status, headers, answer = function(
Oct 07 16:37:07 martin env[45098]:   File "/home/myUser/.local/lib/python3.9/site-packages/radicale/app/proppatch.py", line 94, in do_PROPPATCH
Oct 07 16:37:07 martin env[45098]:     xml_answer = xml_proppatch(base_prefix, path, xml_content,
Oct 07 16:37:07 martin env[45098]:   File "/home/myUser/.local/lib/python3.9/site-packages/radicale/app/proppatch.py", line 59, in xml_proppatch
Oct 07 16:37:07 martin env[45098]:     collection.set_meta(all_props)
Oct 07 16:37:07 martin env[45098]:   File "/home/myUser/.local/lib/python3.9/site-packages/radicale/storage/__init__.py", line 203, in set_meta
Oct 07 16:37:07 martin env[45098]:     raise NotImplementedError
Oct 07 16:37:07 martin env[45098]: NotImplementedError
capocasa commented 1 year ago

UPDATE

Here is the contents of the proppatch request from logs

Oct 07 16:37:07 martin env[45098]: <?xml version="1.0"?>
Oct 07 16:37:07 martin env[45098]: <propertyupdate xmlns="DAV:" xmlns:ICAL="http://apple.com/ns/ical/">
Oct 07 16:37:07 martin env[45098]:   <set>
Oct 07 16:37:07 martin env[45098]:     <prop>
Oct 07 16:37:07 martin env[45098]:       <ICAL:calendar-order>2</ICAL:calendar-order>
Oct 07 16:37:07 martin env[45098]:     </prop>
Oct 07 16:37:07 martin env[45098]:   </set>
Oct 07 16:37:07 martin env[45098]: </propertyupdate>
capocasa commented 1 year ago

Further update:

Reproduction curl request:

curl -u myName:myPassword --request PROPPATCH "http://localhost:5232/myUser/myCalendar/" --data '<propertyupdate xmlns="DAV:" xmlns:ICAL="http://apple.com/ns/ical/"><set><prop><ICAL:calendar-order>2</ICAL:calendar-order></prop></set></propertyupdate>'

Dirty fix: (does not reply with an error but ignores the proppatch request)

Add the following at the end of the Collection class (Line 197 of radicale_remind.py in version 0.5.0)

    def set_meta(self, props: Mapping[str, str]) -> None:
        pass
jspricke commented 1 year ago

Your fix sounds fine to me. Can you open a pull request with it?

capocasa commented 1 year ago

Done! #29