Skip to content

fix(meeting): fix missing VTIMEZONE in scheduled meeting ICS invites#18040

Open
miaulalala wants to merge 1 commit into
mainfrom
fix/schedule-meeting-vtimezone
Open

fix(meeting): fix missing VTIMEZONE in scheduled meeting ICS invites#18040
miaulalala wants to merge 1 commit into
mainfrom
fix/schedule-meeting-vtimezone

Conversation

@miaulalala
Copy link
Copy Markdown
Contributor

@miaulalala miaulalala commented May 19, 2026

Summary

Fixes #18039

Two bugs in `RoomController::scheduleMeeting()` introduced by #17057:

  • Null timezone crash: `TimezoneService::getUserTimezone()` returns `null` when the user has no timezone configured anywhere (no `core.timezone` pref, no availability property, no calendars with scheduling timezone). Passing `null` to `new \DateTimeZone()` throws a `TypeError`. Fixed by falling back to `getDefaultTimezone()` (server's `default_timezone` config, defaulting to `UTC`).

  • Missing VTIMEZONE in invite emails: `ICalendarEventBuilder::toIcs()` (core) emits `DTSTART;TZID=Europe/Berlin:...` but never includes a `VTIMEZONE` component. RFC 5545 §3.2.19 requires a `VTIMEZONE` component for every `TZID` parameter value. Without it, Sabre's iTIP broker has nothing to copy into the `METHOD:REQUEST` email, so attendees receive an ICS with an unresolved `TZID` reference. Clients like Grommunio misinterpret this as an unknown timezone and show the wrong time.

    This PR injects a proper `VTIMEZONE` block (with `DAYLIGHT`/`STANDARD` sub-components built from PHP's `DateTimeZone::getTransitions()`) into the ICS string before saving to the calendar. No Sabre VObject dependency is added to Talk — the block is assembled as a raw ICS string.

    The root fix is in nextcloud/server (fix(calendar): prefix TZID with '/' to use globally-defined IANA timezone identifiers server#60588). Once that is merged, the `buildVTimezoneBlock` helper and the manual `createFromString` call in this PR can be removed and replaced with a direct `createInCalendar()` call.

Test plan

  • New integration scenarios in `conversation-3/schedule-meeting.feature`: happy path, with title/description, end-before-start rejected (400), regular participant rejected (403)
  • Run: `tests/integration/run.sh conversation-3/schedule-meeting`

🤖 Generated with Claude Code

@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable34

@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable33

@miaulalala
Copy link
Copy Markdown
Contributor Author

/backport to stable32

@miaulalala
Copy link
Copy Markdown
Contributor Author

Once sabre-io/vobject#757 is fixed and vendored, the toIcs() + regex workaround in RoomController::scheduleMeeting() can be reverted back to a plain $eventBuilder->createInCalendar($calendar) call. The null-timezone fallback fix should be kept regardless.

@miaulalala miaulalala force-pushed the fix/schedule-meeting-vtimezone branch from 6c856c7 to aa3aaca Compare May 19, 2026 21:55
AI-Assisted-By: claude-sonnet-4-6 <noreply@anthropic.com>
Signed-off-by: Anna Larch <anna@nextcloud.com>
@miaulalala miaulalala force-pushed the fix/schedule-meeting-vtimezone branch from aa3aaca to 2350fe9 Compare May 20, 2026 10:46
@Antreesy Antreesy requested a review from nickvergessen May 20, 2026 12:15
Copy link
Copy Markdown
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the tests (neither feature nor FeatureContext) to have anything changed in regards to VTIMEZONE?

/**
* @param array $dashboardEvents
* @param TableNode $formData
*/
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc block is disconnected from it's old method

But sounds deletable anyway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Meeting invites miss VTIMEZONE block in attached ICS file

2 participants