Skip to content

fix(dav): allow multiple organizers if possible - #42339

Merged
st3iny merged 1 commit into
masterfrom
fix/dav/allow-multiple-organizers
Dec 19, 2023
Merged

fix(dav): allow multiple organizers if possible#42339
st3iny merged 1 commit into
masterfrom
fix/dav/allow-multiple-organizers

Conversation

@st3iny

Copy link
Copy Markdown
Member

Summary

This is very hacky! However, we want to allow saving events with multiple organizers. Those events are not RFC compliant, but sometimes imported from major external calendar services (e.g. Google). If the current user is not an organizer of the event we ignore the exception as no scheduling messages will be sent anyway.

I'm not very comfortable touching scheduling code so please have a good look. I can provide test ICS files if necessary.

TODO

  • Test, test and test

Checklist

@st3inyst3iny added bug 3. to review Waiting for reviews feature: dav feature: caldav Related to CalDAV internals labels Dec 17, 2023
@st3inyst3iny added this to the Nextcloud 29 milestone Dec 17, 2023
@st3inyst3iny self-assigned this Dec 17, 2023
Comment threadapps/dav/lib/CalDAV/Schedule/Plugin.php Fixed
Comment threadapps/dav/lib/CalDAV/Schedule/Plugin.php Fixed
Comment threadapps/dav/lib/CalDAV/Schedule/Plugin.php Fixed
Comment threadapps/dav/lib/CalDAV/Schedule/Plugin.php Fixed
Comment threadapps/dav/lib/CalDAV/Schedule/Plugin.php Fixed
This is very hacky! However, we want to allow saving events with multiple
organizers. Those events are not RFC compliant, but sometimes imported from major
external calendar services (e.g. Google). If the current user is not an organizer of
the event we ignore the exception as no scheduling messages will be sent anyway.
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny
st3inyforce-pushed the fix/dav/allow-multiple-organizers branch from a906cff to 06aba2aCompareDecember 17, 2023 16:46
throw $e;
}

$addresses = $this->getAddressesForPrincipal($calendarNode->getOwner());

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 1 of OCA\DAV\CalDAV\Schedule\Plugin::getAddressesForPrincipal cannot be null, possibly null value provided

@tcitworldtcitworld left a comment

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.

Logic is fine to me

@miaulalalamiaulalala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks fine to me. Psalm isn't happy :)

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable28

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable27

@st3iny

Copy link
Copy Markdown
MemberAuthor

/backport to stable26

@gohrner

Copy link
Copy Markdown

@st3iny: Regarding:

It would be cleaner to patch Sabre to validate organizers after checking if
scheduling messages are necessary. Currently, organizers are validated first and
afterwards the broker checks if messages should be scheduled. So the code will throw
even if the organizers are not relevant. This is to ensure compliance with RFCs but
a bit too strict for real world usage.

Did you file an CR for SabreDAV to adjust this and get their feedback?

@blizzzblizzz mentioned this pull request Mar 5, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugfeature: caldavRelated to CalDAV internalsfeature: dav

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

[Bug]: "Every instance of the event must have the same organizer."

5 participants

@st3iny@gohrner@tcitworld@miaulalala@github-advanced-security