Skip to content

fix(itip): don't parse master as a date when it's missing from the new event - #794

Open
SebastianKrupinski wants to merge 1 commit into
sabre-io:masterfrom
SebastianKrupinski:fix/attendee-reply-master-instance-removed
Open

SebastianKrupinski wants to merge 1 commit into
sabre-io:masterfrom
SebastianKrupinski:fix/attendee-reply-master-instance-removed

Conversation

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Summary

Broker::parseEvent() throws InvalidDataException: The supplied iCalendar datetime value is incorrect: master when an attendee updates an event and the new version no longer contains the master event the attendee was part of.

Issue

In parseEventForAttendee(), instances are gathered from both the old and new event info. If the old event had the attendee in the master VEVENT, but the new event only contains an instance with a RECURRENCE-ID (some clients, e.g. eM Client with Exchange-originated events, add a RECURRENCE-ID to non-recurring events), the master instance ends up with oldstatus set and newstatus null.

Because the statuses differ, a reply is built for it. Since master is not present in $eventInfo['instances'], the code falls into the branch intended for instances removed via EXDATE and calls DateTimeParser::parse('master', ...), which throws. The exception aborts the whole CalDAV PUT from the client.

Correction

Skip the master instance when generating the reply if the new event has no master instance, since there is nothing to reply for. Replies for the remaining instances (e.g. the one with the RECURRENCE-ID) are generated as before.

{
            "file": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/DateTimeParser.php",
            "line": 205,
            "function": "parseDateTime",
            "class": "Sabre\\VObject\\DateTimeParser",
            "type": "::"
        },
        {
            "file": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/ITip/Broker.php",
            "line": 758,
            "function": "parse",
            "class": "Sabre\\VObject\\DateTimeParser",
            "type": "::"
        },
        {
            "file": "/var/www/nextcloud/3rdparty/sabre/vobject/lib/ITip/Broker.php",
            "line": 253,
            "function": "parseEventForAttendee",
            "class": "Sabre\\VObject\\ITip\\Broker",
            "type": "->"
        },
        {
            "file": "/var/www/nextcloud/3rdparty/sabre/dav/lib/CalDAV/Schedule/Plugin.php",
            "line": 616,
            "function": "parseEvent",
            "class": "Sabre\\VObject\\ITip\\Broker",
            "type": "->"
        },

…w event

Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.66%. Comparing base (6eee31d) to head (2e9581e).
⚠️ Report is 82 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #794      +/-   ##
============================================
- Coverage     98.76%   98.66%   -0.11%     
+ Complexity     1876     1759     -117     
============================================
  Files            71       71              
  Lines          5345     5167     -178     
============================================
- Hits           5279     5098     -181     
- Misses           66       69       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant