nextcloud / nextcloud/server

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

Open
#52,979 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

1. to develop 29-feedback bug feature: caldav
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
  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.