Skip to content

fix(CalDAV/Schedule): reset PARTSTAT when the organizer reschedules - #1678

Open
ndo84bw wants to merge 2 commits into
sabre-io:masterfrom
ndo84bw:reset-partstat-on-reschedule
Open

ndo84bw wants to merge 2 commits into
sabre-io:masterfrom
ndo84bw:reset-partstat-on-reschedule

Conversation

@ndo84bw

@ndo84bw ndo84bw commented Oct 6, 2026 •

Copy link
Copy Markdown

Fixes #1282. Replaced orphaned #1443

Problem:
When an organizer moves an event, attendees keep their old response (e.g., "Accepted"). According to the standard (RFC 6638 Section 3.2.8), the status should reset to "Needs Action" so attendees can confirm the new time.

Solution:
The status is now reset to "Needs Action" if:

  • The start or end time changes.
  • A single occurrence in a series is moved.
  • Changes to recurrence rules add new dates.

Key Details:

  • Applies only to events (VEVENTs) and server-managed attendees.
  • The reset happens before notifications are sent, ensuring everyone sees the same status.

Simplifications:

  • Any change to the recurrence rhythm counts as a reschedule.
  • Time is compared as a point in time (changing the time zone without changing the actual time does not trigger a reset).
  • If dates cannot be read, the status is reset just to be safe.

Testing:

Unit tests: tests/Sabre/CalDAV/Schedule/ScheduleRescheduleTest.php (60 tests).

Case Expected
Start, end or duration changed reset
Same time written differently (other time zone, DURATION instead of DTEND, end written out) kept
Only summary, location or status changed kept
One occurrence moved only this occurrence is reset
Occurrence changed, but at the same time kept
Whole series moved, changed occurrence moves with it both are reset
Whole series moved, changed occurrence keeps its time series is reset, occurrence is kept
RECURRENCE-ID of an occurrence written in another time zone kept
Reply to one occurrence across a daylight saving time change reply is kept
Recurrence rule: frequency, interval or weekday changed reset
Recurrence rule: fewer occurrences, earlier end, EXDATE added, RDATE removed kept
Recurrence rule: more occurrences, later end, EXDATE removed, RDATE added reset
Series extended, with a changed occurrence series is reset, occurrence is kept
Recurrence rule cannot be read reset
Organizer is also an attendee organizer is kept
SCHEDULE-AGENT=CLIENT or NONE kept
Attendee changes their own copy kept
VTODO not touched

Manual tests with Thunderbird 159 against sabre, without and with this patch. Without the patch, no PARTSTAT is reset in any of these cases. With the patch:

  • move the whole series: series is reset
  • move one occurrence: only this occurrence is reset
  • reply to one occurrence across a daylight saving time change: reply is kept
  • move a series with a changed occurrence (the occurrence keeps its time): series is reset, occurrence is not
  • change only the title: nothing is reset
  • shorten the series: nothing is reset
  • extend the series with a changed occurrence: series is reset, occurrence is not

Manual tests with Thunderbird 159 against Nextcloud 36 dev (sabre/dav 4.7.0 with this patch): same cases, same results. Without the patch, Nextcloud keeps the old PARTSTAT. Nextcloud calls processICalendarChange() from its own calendarObjectChange(), so it needs no change.

When the organizer moves an event, attendees keep their old answer.
RFC 6638, Section 3.2.8 says they must be asked again.

Set PARTSTAT to NEEDS-ACTION for all attendees except the organizer
when the start or end changes, or when the recurrence adds new dates.

Fixes sabre-io#1282

Assisted-by: claude-code:claude-opus-5-5
A reply for one occurrence could be lost if the event crosses a
daylight saving change. The end of the occurrence is now calculated the
same way as in VObject.

If the whole series moves, a changed occurrence is only reset if its
own time changes.

RECURRENCE-ID is compared as a point in time.

Also make the code easier to read: one method decides if an event was
rescheduled, and the organizer is checked once.

Assisted-by: claude-code:claude-opus-5-5
@ndo84bw

ndo84bw commented Nov 13, 2026

Copy link
Copy Markdown
Author

Patch update: reviews with Claude (Fable 5.2 and Opus 5.5) found two bugs.

If an attendee replies to a single occurrence, and this occurrence spans a daylight saving time change, the reply was reset to NEEDS-ACTION right away.

When the whole series moves, a changed occurrence is now only reset if its own time changes. Before, this depended on how the client stores the occurrence. (Found with Thunderbird)

RECURRENCE-ID is now compared as a point in time, not as text. The same time in another time zone is not a change.

New tests for all of this. I also tested it manually with Thunderbird against sabre and against Nextcloud, see the updated description.

@SebastianKrupinski, do you think processICalendarChange() is the right place for this? It also runs when a reply from an attendee comes in, where a reset is never needed. The alternative would be calendarObjectChange(), but Nextcloud overrides it and would need one extra line there.

And are you fine with the simplification that every change to the RRULE counts as a reschedule, except when the series only ends earlier? The alternative I see is to calculate all occurrences and compare them. For a series without an end this needs a limit.

@SebastianKrupinski

Copy link
Copy Markdown
Contributor

Hi @ndo84bw

So a few issues with this PR:

a) we override the entire processICalendarChange() in NC none of the changes here have any effect.
b) the iCal RFC allows an organizer to set the participant status. Therefore your changes would break that... if a organizer creates an exception or changes the time and sets the participant status this would then clear it. We even allow this in NC.
c) resting the participant status the the responsibility of the client, not the server, the responsibility of the server is only to save the information and to generate iTip messages, not to alter user information.

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.

SchedulingPlugin does not respect RFC 6638 3.2.8.

2 participants