[Bug]: Calendar::search returns recurrences that do not match search pattern if used in conjunction with a timerange
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
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
- Create a recurring event with an attendee
alice - Create a recurrence exception for this event, adding a new attendee
bobfor this recurrence exception only - Search with a pattern of
bob, a search property ofATTENDEEand limit your search to a time frame that does not include the recurrence exception withbob - See that a recurrence is returned, even though
bobis not a match on theATTENDEEproperty.
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Calendar::search entry point and reproduce the listed recurring-event case with a recurrence exception, the bob pattern, and a time range excluding that exception. Trace how recurrence exceptions and expanded recurrences are considered during the search. Done means the specified time range returns no result when bob is present only on an excluded recurrence exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100