Skip to content

[Bug]: Calendar::search returns recurrences that do not match search pattern if used in conjunction with a timerange #52979

Description

@miaulalala

Bug description

When passing a pattern to the search in conjunction with a time range, the pattern is matched first via oc_calendarobjects_props.

In case of an event with recurrence exceptions, it will also match on the recurrence exceptions.

The search then returns the recurrences that fit within the time range specified, even if the pattern does not match for the expanded recurrence(s) and are only a match for the recurrence exception.

Steps to reproduce

  1. Create a recurring event with an attendee alice
  2. Create a recurrence exception for this event, adding a new attendee bob for this recurrence exception only
  3. Search with a pattern of bob, a search property of ATTENDEE and limit your search to a time frame that does not include the recurrence exception with bob
  4. See that a recurrence is returned, even though bob is not a match on the ATTENDEE property.

Expected behavior

No search results are returned as there are no events where bob is an attendee in the specified time range.

Nextcloud Server version

master

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    Status
    Confirmed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions