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

Support filtering on recurring events #224

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

jelmer
Copy link
Owner

@jelmer jelmer commented Oct 22, 2022

Support filtering on recurring events.

Fixes #8

@jelmer jelmer marked this pull request as draft October 22, 2022 20:14
@jelly
Copy link

jelly commented Jan 18, 2023

I'm a happy xandikos user and was working on making my eink screen display my weekly calendar but found out that searching with a start/end does not expand my recurring appointments. So I tried to test this PR and with my local data it fails with this backtrace.

This is reproduced with the python caldav module:

client = DAVClient('http://localhost:8080/user/calendars/', auth=None, ssl_verify_cert=False)
calendar = client.principal().calendar('calendar')
events = calendar.search(start=now, end=end, event=True)
127.0.0.1 [17/Jan/2023:21:29:45 +0000] "PROPFIND /user/calendars/calendar/ HTTP/1.1" 207 423 "-" "Mozilla/5.0"
Error handling request
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/usr/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/web.py", line 1489, in xandikos_handler
    return await main_app.aiohttp_handler(request, options.route_prefix)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/webdav.py", line 2152, in aiohttp_handler
    response = await self._handle_request(request, environ)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/webdav.py", line 2108, in _handle_request
    return await do.handle(request, environ, self)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/webdav.py", line 1764, in handle
    return await reporter.report(
  File "/home/jelle/projects/xandikos/./bin/../xandikos/webdav.py", line 353, in wrapper
    async for resp in req_fn(self, environ, *args, **kwargs):
  File "/home/jelle/projects/xandikos/./bin/../xandikos/caldav.py", line 566, in report
    async for (href, resource) in webdav.traverse_resource(
  File "/home/jelle/projects/xandikos/./bin/../xandikos/webdav.py", line 1205, in traverse_resource
    for (child_name, child_resource) in members_fn(resource):
  File "/home/jelle/projects/xandikos/./bin/../xandikos/web.py", line 637, in calendar_query
    for (name, file, etag) in self.store.iter_with_filter(filter=filter):
  File "/home/jelle/projects/xandikos/./bin/../xandikos/store/__init__.py", line 314, in _iter_with_filter_naive
    if filter.check(name, file):
  File "/home/jelle/projects/xandikos/./bin/../xandikos/icalendar.py", line 843, in check
    c = file.expanded_calendar
  File "/home/jelle/projects/xandikos/./bin/../xandikos/icalendar.py", line 928, in expanded_calendar
    self._expanded_calendar = expand_calendar_rrule(self.calendar)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/icalendar.py", line 1080, in expand_calendar_rrule
    for outsub in _expand_rrule_component(
  File "/home/jelle/projects/xandikos/./bin/../xandikos/icalendar.py", line 1034, in _expand_rrule_component
    rs = rruleset_from_comp(incomp)
  File "/home/jelle/projects/xandikos/./bin/../xandikos/icalendar.py", line 1011, in rruleset_from_comp
    rrulestr = comp["RRULE"].to_ical().decode("utf-8")
AttributeError: 'list' object has no attribute 'to_ical'
127.0.0.1 [17/Jan/2023:21:29:48 +0000] "REPORT /user/calendars/calendar/ HTTP/1.1" 500 245 "-" "Mozilla/5.0"

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

Successfully merging this pull request may close these issues.

support recurring events
2 participants