getEventsByDate seems to have not the correct response for iCal
4myhealth opened this issue · 4 comments
if you set your phone (iPhone) to only sync the calendar in the last 3 months, then the calendarapp does not show any appointments anymore.
the response xml of getEventsByDate is different to getEventsForCalendar.
the response of getEventsByDate:
<D:response>\n <D:href>/caldav/cal/mh%404myhealth/3/3c650653-aaf3-11ea-92ee-134a1fc8b503.ics</D:href>\n <D:propstat>\n <D:status>HTTP/1.1 200 OK</D:status>\n </D:propstat>\n </D:response>
response of getEventsForCalendar:
<D:response>\n <D:href>/caldav/cal/mh%404myhealth/3/3c650653-aaf3-11ea-92ee-134a1fc8b503.ics</D:href>\n <D:propstat>\n <D:status>HTTP/1.1 200 OK</D:status>\n <D:prop>\n <D:getcontenttype>text/calendar; charset=utf-8; component=VEVENT</D:getcontenttype>\n <D:getetag/>\n </D:prop>\n </D:propstat>\n </D:response>
after the client received the response of getEventsForCalendar, the client is loading every single event.
thats not the case for getEventsByDate.
maybe because of the missing "D:getcontenttype" tag.
i hope this helps to fixing the issue.
I'm having trouble understanding the problem. If you have events in the future, but none in the past, and set your iPhone to only sync the calendar in the last 3 months, wouldn't it be correct to not show any appointments anymore?
to avoid loading the complete calendar, you can set your phone to sync only with last 3 months + all future events.
in that case, the phone shows not a single event (i have events in the past and future.).
what i found, the phone loads the xml with the list of events for given calender or daterange. after the list received the phone loads every single event for detailed information. in case of getEventsForCalender it works fine. in case of getEventsByDate the phone does not load the single events for detailed information. i looked at the response and found a difference i mentioned in my first comment.
i could provide some screenshots if you want me too :)
The problem is with the parsing of the request
<?xml version="1.0" encoding="UTF-8"?>
<L:calendar-query xmlns:L="urn:ietf:params:xml:ns:caldav">
<D:prop xmlns:D="DAV:">
<D:getcontenttype/>
<D:getetag/>
<L:calendar-data/>
</D:prop>
<L:filter>
<L:comp-filter name="VCALENDAR">
<L:comp-filter name="VEVENT">
<L:time-range start="..." end="..."/>
</L:comp-filter>
</L:comp-filter>
</L:filter>
</L:calendar-query>
The children of the calendar-query
element are overlooked by the statement
xml.getWithChildren('/CAL:calendar-query/D:prop', ctx.request.xml);
because the getWithChildren
method is "hardwired" to the path /D:propfind/D:prop
, see here.
thanks for fixing! works fine now! <3