-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dav)!: add webhook compatibility for calendar object events #51082
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be a public API?
The events are in OCA, not OCP. There are no compatibility or stability guarantees in private app namespaces.
Ah right, I forgot about that. So if webhooks can only listen to events in the public namespace, would adding a new namespace such as EDIT: actually, in the webhook listeners documentation, there are some webhook events that are still in the OCA namespace, so I'm not sure if the workaround is really necessary. |
That is true and worrying to me, but on the other hand not my responsibility. For caldav and carddav I will require a strict separation of private and public API, so we can continue to make easy modifications to internals, and have a solid, stable API for selected classes. So yes, if these events are consumed by other apps, please move them to OCP. Do not extend private types from the public API. Just move them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See above. The goal of this PR is to expose a public API, which internal events aren't.
Thanks you for you contribution
aa749d0
to
82477b8
Compare
/backport to stable31 |
@AndyScherzinger are we backporting new APIs for this? |
82477b8
to
7ee0155
Compare
In this case yes, else the customer needs to wait until v32 enterprise. |
7ee0155
to
4448a2f
Compare
I think I have everything setup now, but let me know if I'm missing anything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 👍
My 2 cents: I get the customer specific need, but it would be nice to have all events (not just calendar object creation) at the same time targeting the same API level. |
I'm not sure I get your message. Do you mean also moving/exposing the other calendar events? |
Added the remaining events for the calendar objects now, will get to the documentation shortly. |
86fd59c
to
38ec4cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are gonna break some apps I think. But it's fine as the OCA
stuff is not a public API.
Signed-off-by: Edward Ly <[email protected]>
Signed-off-by: Edward Ly <[email protected]>
38ec4cc
to
dee1d4f
Compare
Still, make sure that it’s part of the ugrade guide for apps. |
Seeing this remark on the above mentioned issue by @JonathanTreffler
That's correct, OCP events should be able to be emitted by any app (not just |
Is that theoritical or are there other calendar backends out there? |
Not many, but https://github.com/nextcloud/deck/blob/0223dd9a3a50838a202f3c68ed714e80b00dd2ae/lib/DAV/CalendarPlugin.php#L16 for example. |
Currently not many, but I sure hope we some day have an equivalent to groupfolders for calendars (so basicaly calendars that are not owned by any user but are global to the system). (And unless somebody else starts that project before I get to it I plan on being the person who writes that) |
Yes they could, but what are they going to put in as calendarId ? Unlike files where the fileIds are unique in the filecache globally no matter which app mounted it in the filesystem AFAIK calendars are only uniquely addressable over their principalUri + uri and the id is an implementation detail of the provider and not unique (please somebody correct me if I got that wrong 😆 ). (In dav_push we stopped referencing calendars by principalUri + uri and instead now reference calendars by provider name + id, because those are the same no matter from which users perspective you look at it (for example a shared calendar has a different uri from the perspective of the user shared to, but the same id)) |
Hi @JonathanTreffler not sure if it went unnoticed but due to #51331 this change will also become active in a 31 when merged and shipped, since I can't wait to for 32 due to customer needs. While I can judge if there is a non-breaking way for Nc31? @ChristophWurst |
Thank you for making me aware of that, i totally missed the backport. I am going to look into hooking into the the old or new events depending on what is available, but if that is not possible I think it would also be fine to require the latest release of 31 for dav_push. |
Summary
Adds webhook compatibility to event whenever a new calendar object (e.g. calendar event) is created via implementation of
OCP\EventDispatcher\IWebhookCompatibleEvent
.TODO
Checklist