Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export with expand=1 fails with start= and end= parameters despite being required #1325

Open
AMA3 opened this issue Jan 2, 2025 · 1 comment

Comments

@AMA3
Copy link

AMA3 commented Jan 2, 2025

Baikal version: 0.10.1

Expected behaviour:
ICS calendar should be exported with events between start and end times.

Current behaviour:
With expand=1 but not start= or end=, Baikal says:

<d:error>
<s:sabredav-version>4.7.0</s:sabredav-version>
<s:exception>Sabre\DAV\Exception\BadRequest</s:exception>
<s:message>
If you'd like to expand recurrences, you must specify both a start= and end= parameter.
</s:message>
</d:error>

With expand=1 plus a start= and end= timestamp, Baikal says:

<d:error>
<s:sabredav-version>4.7.0</s:sabredav-version>
<s:exception>Sabre\VObject\ParseException</s:exception>
<s:message>
This parser only supports VCARD and VCALENDAR files
</s:message>
</d:error>

With start= and end= but not expand=1, Baikal says:

BEGIN:VCALENDAR
VERSION:2.0
CALSCALE:GREGORIAN
PRODID:-//SabreDAV//SabreDAV 4.7.0//EN
X-WR-CALNAME:Calendar Name
X-APPLE-CALENDAR-COLOR:#ff9800ff
END:VCALENDAR

Steps to reproduce:

  1. Issue a request such as:
    https://SERVER/dav.php/calendars/USER/CAL/?export&expand=1
  2. Issue a request such as:
    https://SERVER/dav.php/calendars/USER/CAL/?export&expand=1&start=1736485200&end=1736571599
  3. Issue a request such as:
    https://SERVER/dav.php/calendars/USER/CAL/?export&start=1736485200&end=1736571599

I was previously using sabre/dav 4.4 without Baikal and the second option (with all of expand=1, start= and end= parameters) correctly returned the calendar's events between the start and end times.

@AMA3
Copy link
Author

AMA3 commented Jan 9, 2025

I went back and re-installed my old sabre/dav 4.4 calendar server accessing the same database, and it is giving me the same error for the second request. So I tried to do a little debugging, and this is what I found before getting lost.

  1. The error is caused by an exception thrown on line 169 of vendor/sabre/vobject/lib/Parser/MimeDir.php.
  2. The error is because the switch on line 161 encounters a timezone string (America/New_York) instead of an expected BEGIN:VCALENDAR or BEGIN:VCARD.
  3. The call to $this->server->getProperties() on line 236 of vendor/sabre/dav/lib/CalDAV/ICSExportPlugin.php is, according to the comment that follows, supposed to return "a VCALENDAR with a single VTIMEZONE." However, it seems to just return the timezone string, not wrapped in a VCALENDAR.

I hope this helps someone in figuring out the problem! I couldn't trace through the code any farther to figure out where this property value is obtained from. If someone knows and can point me in the right direction, I might be able to debug further.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant