Repository: nextcloud/server
Pull request #51082: feat(dav)!: add webhook compatibility for calendar object events
Author: login: edward-ly
Labels: name: 4. to release
description: Ready to be released and/or waiting for tests to finish
name: feature: dav
name: pending documentation
description: This pull request needs an associated documentation update
Created: 2025-02-27T06:11:53Z | Merged: 2025-03-07T16:42:11Z

<!--
  - 🚨 SECURITY INFO
  -
  - Before sending a pull request that fixes a security issue please report it via our HackerOne page (https://hackerone.com/nextcloud) following our security policy (https://nextcloud.com/security/). This allows us to coordinate the fix and release without potentially exposing all Nextcloud servers and users in the meantime.
-->
## Summary

Adds webhook compatibility to event whenever a new calendar object (e.g. calendar event) is created via implementation of `OCP\EventDispatcher\IWebhookCompatibleEvent`.

## TODO

- [x] Add new events to [webhook listeners manual page](https://docs.nextcloud.com/server/latest/admin_manual/webhook_listeners/index.html#nextcloud-webhook-events)
- (possibly others, let me know if I'm missing anything)

## Checklist

- Code is [properly formatted](https://docs.nextcloud.com/server/latest/developer_manual/digging_deeper/continuous_integration.html#linting)
- [Sign-off message](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md) is added to all commits
- [ ] Tests ([unit](https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html#unit-tests), [integration](https://docs.nextcloud.com/server/latest/developer_manual/app_development/tutorial.html#integration-tests), api and/or acceptance) are included
- [ ] Screenshots before/after for front-end changes
- [x] Documentation ([manuals](https://github.com/nextcloud/documentation/) or wiki) has been updated or is not required
- [ ] [Backports requested](https://github.com/nextcloud/backportbot/#usage) where applicable (ex: critical bugfixes)



Diff:
diff --git a/apps/dav/composer/composer/autoload_classmap.php b/apps/dav/composer/composer/autoload_classmap.php
index 19db47d7cab6e..17533c9cf74b4 100644
--- a/apps/dav/composer/composer/autoload_classmap.php
+++ b/apps/dav/composer/composer/autoload_classmap.php
@@ -255,12 +255,6 @@
     'OCA\\DAV\\Events\\CalendarCreatedEvent' => $baseDir . '/../lib/Events/CalendarCreatedEvent.php',
     'OCA\\DAV\\Events\\CalendarDeletedEvent' => $baseDir . '/../lib/Events/CalendarDeletedEvent.php',
     'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => $baseDir . '/../lib/Events/CalendarMovedToTrashEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => $baseDir . '/../lib/Events/CalendarObjectCreatedEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => $baseDir . '/../lib/Events/CalendarObjectDeletedEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectMovedEvent' => $baseDir . '/../lib/Events/CalendarObjectMovedEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => $baseDir . '/../lib/Events/CalendarObjectMovedToTrashEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => $baseDir . '/../lib/Events/CalendarObjectRestoredEvent.php',
-    'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => $baseDir . '/../lib/Events/CalendarObjectUpdatedEvent.php',
     'OCA\\DAV\\Events\\CalendarPublishedEvent' => $baseDir . '/../lib/Events/CalendarPublishedEvent.php',
     'OCA\\DAV\\Events\\CalendarRestoredEvent' => $baseDir . '/../lib/Events/CalendarRestoredEvent.php',
     'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => $baseDir . '/../lib/Events/CalendarShareUpdatedEvent.php',
diff --git a/apps/dav/composer/composer/autoload_static.php b/apps/dav/composer/composer/autoload_static.php
index 2965b78beb2b5..768fda98443f6 100644
--- a/apps/dav/composer/composer/autoload_static.php
+++ b/apps/dav/composer/composer/autoload_static.php
@@ -270,12 +270,6 @@ class ComposerStaticInitDAV
         'OCA\\DAV\\Events\\CalendarCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarCreatedEvent.php',
         'OCA\\DAV\\Events\\CalendarDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarDeletedEvent.php',
         'OCA\\DAV\\Events\\CalendarMovedToTrashEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarMovedToTrashEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectCreatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectCreatedEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectDeletedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectDeletedEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectMovedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectMovedEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectMovedToTrashEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectMovedToTrashEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectRestoredEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectRestoredEvent.php',
-        'OCA\\DAV\\Events\\CalendarObjectUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarObjectUpdatedEvent.php',
         'OCA\\DAV\\Events\\CalendarPublishedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarPublishedEvent.php',
         'OCA\\DAV\\Events\\CalendarRestoredEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarRestoredEvent.php',
         'OCA\\DAV\\Events\\CalendarShareUpdatedEvent' => __DIR__ . '/..' . '/../lib/Events/CalendarShareUpdatedEvent.php',
diff --git a/apps/dav/lib/AppInfo/Application.php b/apps/dav/lib/AppInfo/Application.php
index 4db58b0f137fc..b3aff922ba0b2 100644
--- a/apps/dav/lib/AppInfo/Application.php
+++ b/apps/dav/lib/AppInfo/Application.php
@@ -30,12 +30,6 @@
 use OCA\DAV\Events\CalendarCreatedEvent;
 use OCA\DAV\Events\CalendarDeletedEvent;
 use OCA\DAV\Events\CalendarMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
-use OCA\DAV\Events\CalendarObjectDeletedEvent;
-use OCA\DAV\Events\CalendarObjectMovedEvent;
-use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectRestoredEvent;
-use OCA\DAV\Events\CalendarObjectUpdatedEvent;
 use OCA\DAV\Events\CalendarPublishedEvent;
 use OCA\DAV\Events\CalendarRestoredEvent;
 use OCA\DAV\Events\CalendarShareUpdatedEvent;
@@ -75,6 +69,12 @@
 use OCP\AppFramework\Bootstrap\IBootstrap;
 use OCP\AppFramework\Bootstrap\IRegistrationContext;
 use OCP\AppFramework\IAppContainer;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
 use OCP\Calendar\IManager as ICalendarManager;
 use OCP\Config\BeforePreferenceDeletedEvent;
 use OCP\Config\BeforePreferenceSetEvent;
diff --git a/apps/dav/lib/CalDAV/CalDavBackend.php b/apps/dav/lib/CalDAV/CalDavBackend.php
index 0c8b52a7491c7..349a4ec3630e5 100644
--- a/apps/dav/lib/CalDAV/CalDavBackend.php
+++ b/apps/dav/lib/CalDAV/CalDavBackend.php
@@ -19,12 +19,6 @@
 use OCA\DAV\Events\CalendarCreatedEvent;
 use OCA\DAV\Events\CalendarDeletedEvent;
 use OCA\DAV\Events\CalendarMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
-use OCA\DAV\Events\CalendarObjectDeletedEvent;
-use OCA\DAV\Events\CalendarObjectMovedEvent;
-use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectRestoredEvent;
-use OCA\DAV\Events\CalendarObjectUpdatedEvent;
 use OCA\DAV\Events\CalendarPublishedEvent;
 use OCA\DAV\Events\CalendarRestoredEvent;
 use OCA\DAV\Events\CalendarShareUpdatedEvent;
@@ -34,6 +28,12 @@
 use OCA\DAV\Events\SubscriptionDeletedEvent;
 use OCA\DAV\Events\SubscriptionUpdatedEvent;
 use OCP\AppFramework\Db\TTransactional;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
 use OCP\Calendar\Exceptions\CalendarException;
 use OCP\DB\Exception;
 use OCP\DB\QueryBuilder\IQueryBuilder;
diff --git a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php b/apps/dav/lib/Events/CalendarObjectDeletedEvent.php
deleted file mode 100644
index 9928080f99b2a..0000000000000
--- a/apps/dav/lib/Events/CalendarObjectDeletedEvent.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * Class CalendarObjectDeletedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
- */
-class CalendarObjectDeletedEvent extends Event {
-
-	/**
-	 * CalendarObjectDeletedEvent constructor.
-	 *
-	 * @param int $calendarId
-	 * @param array $calendarData
-	 * @param array $shares
-	 * @param array $objectData
-	 * @since 20.0.0
-	 */
-	public function __construct(
-		private int $calendarId,
-		private array $calendarData,
-		private array $shares,
-		private array $objectData,
-	) {
-		parent::__construct();
-	}
-
-	/**
-	 * @return int
-	 * @since 20.0.0
-	 */
-	public function getCalendarId(): int {
-		return $this->calendarId;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getCalendarData(): array {
-		return $this->calendarData;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getShares(): array {
-		return $this->shares;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getObjectData(): array {
-		return $this->objectData;
-	}
-}
diff --git a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php b/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php
deleted file mode 100644
index a26aca4ff2bfa..0000000000000
--- a/apps/dav/lib/Events/CalendarObjectMovedToTrashEvent.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * @since 22.0.0
- */
-class CalendarObjectMovedToTrashEvent extends Event {
-
-	/**
-	 * @param int $calendarId
-	 * @param array $calendarData
-	 * @param array $shares
-	 * @param array $objectData
-	 * @since 22.0.0
-	 */
-	public function __construct(
-		private int $calendarId,
-		private array $calendarData,
-		private array $shares,
-		private array $objectData,
-	) {
-		parent::__construct();
-	}
-
-	/**
-	 * @return int
-	 * @since 22.0.0
-	 */
-	public function getCalendarId(): int {
-		return $this->calendarId;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getCalendarData(): array {
-		return $this->calendarData;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getShares(): array {
-		return $this->shares;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getObjectData(): array {
-		return $this->objectData;
-	}
-}
diff --git a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php b/apps/dav/lib/Events/CalendarObjectRestoredEvent.php
deleted file mode 100644
index 99d752de466ae..0000000000000
--- a/apps/dav/lib/Events/CalendarObjectRestoredEvent.php
+++ /dev/null
@@ -1,65 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * @since 22.0.0
- */
-class CalendarObjectRestoredEvent extends Event {
-
-	/**
-	 * @param int $calendarId
-	 * @param array $calendarData
-	 * @param array $shares
-	 * @param array $objectData
-	 * @since 22.0.0
-	 */
-	public function __construct(
-		private int $calendarId,
-		private array $calendarData,
-		private array $shares,
-		private array $objectData,
-	) {
-		parent::__construct();
-	}
-
-	/**
-	 * @return int
-	 * @since 22.0.0
-	 */
-	public function getCalendarId(): int {
-		return $this->calendarId;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getCalendarData(): array {
-		return $this->calendarData;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getShares(): array {
-		return $this->shares;
-	}
-
-	/**
-	 * @return array
-	 * @since 22.0.0
-	 */
-	public function getObjectData(): array {
-		return $this->objectData;
-	}
-}
diff --git a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php b/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php
deleted file mode 100644
index 8c4b843609d94..0000000000000
--- a/apps/dav/lib/Events/CalendarObjectUpdatedEvent.php
+++ /dev/null
@@ -1,70 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-/**
- * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
- * SPDX-License-Identifier: AGPL-3.0-or-later
- */
-namespace OCA\DAV\Events;
-
-use OCP\EventDispatcher\Event;
-
-/**
- * Class CalendarObjectUpdatedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
- */
-class CalendarObjectUpdatedEvent extends Event {
-
-	/**
-	 * CalendarObjectUpdatedEvent constructor.
-	 *
-	 * @param int $calendarId
-	 * @param array $calendarData
-	 * @param array $shares
-	 * @param array $objectData
-	 * @since 20.0.0
-	 */
-	public function __construct(
-		private int $calendarId,
-		private array $calendarData,
-		private array $shares,
-		private array $objectData,
-	) {
-		parent::__construct();
-	}
-
-	/**
-	 * @return int
-	 * @since 20.0.0
-	 */
-	public function getCalendarId(): int {
-		return $this->calendarId;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getCalendarData(): array {
-		return $this->calendarData;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getShares(): array {
-		return $this->shares;
-	}
-
-	/**
-	 * @return array
-	 * @since 20.0.0
-	 */
-	public function getObjectData(): array {
-		return $this->objectData;
-	}
-}
diff --git a/apps/dav/lib/Listener/ActivityUpdaterListener.php b/apps/dav/lib/Listener/ActivityUpdaterListener.php
index 700bc2f306c62..f291e424c41c9 100644
--- a/apps/dav/lib/Listener/ActivityUpdaterListener.php
+++ b/apps/dav/lib/Listener/ActivityUpdaterListener.php
@@ -13,14 +13,14 @@
 use OCA\DAV\Events\CalendarCreatedEvent;
 use OCA\DAV\Events\CalendarDeletedEvent;
 use OCA\DAV\Events\CalendarMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
-use OCA\DAV\Events\CalendarObjectDeletedEvent;
-use OCA\DAV\Events\CalendarObjectMovedEvent;
-use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectRestoredEvent;
-use OCA\DAV\Events\CalendarObjectUpdatedEvent;
 use OCA\DAV\Events\CalendarRestoredEvent;
 use OCA\DAV\Events\CalendarUpdatedEvent;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventListener;
 use Psr\Log\LoggerInterface;
diff --git a/apps/dav/lib/Listener/CalendarContactInteractionListener.php b/apps/dav/lib/Listener/CalendarContactInteractionListener.php
index 8e574e150cd85..a7f00e452c47d 100644
--- a/apps/dav/lib/Listener/CalendarContactInteractionListener.php
+++ b/apps/dav/lib/Listener/CalendarContactInteractionListener.php
@@ -9,9 +9,9 @@
 namespace OCA\DAV\Listener;
 
 use OCA\DAV\Connector\Sabre\Principal;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
-use OCA\DAV\Events\CalendarObjectUpdatedEvent;
 use OCA\DAV\Events\CalendarShareUpdatedEvent;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
 use OCP\Contacts\Events\ContactInteractedWithEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventDispatcher;
diff --git a/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php b/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php
index 544c88af929c2..a58fb3524abeb 100644
--- a/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php
+++ b/apps/dav/lib/Listener/CalendarObjectReminderUpdaterListener.php
@@ -13,12 +13,12 @@
 use OCA\DAV\CalDAV\Reminder\ReminderService;
 use OCA\DAV\Events\CalendarDeletedEvent;
 use OCA\DAV\Events\CalendarMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
-use OCA\DAV\Events\CalendarObjectDeletedEvent;
-use OCA\DAV\Events\CalendarObjectMovedToTrashEvent;
-use OCA\DAV\Events\CalendarObjectRestoredEvent;
-use OCA\DAV\Events\CalendarObjectUpdatedEvent;
 use OCA\DAV\Events\CalendarRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventListener;
 use Psr\Log\LoggerInterface;
diff --git a/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php b/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php
index 7b517c93d5d2b..78769c7fb4779 100644
--- a/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php
+++ b/apps/dav/tests/unit/Listener/ActivityUpdaterListenerTest.php
@@ -12,8 +12,8 @@
 use OCA\DAV\CalDAV\Activity\Provider\Event;
 use OCA\DAV\DAV\Sharing\Plugin as SharingPlugin;
 use OCA\DAV\Events\CalendarDeletedEvent;
-use OCA\DAV\Events\CalendarObjectDeletedEvent;
 use OCA\DAV\Listener\ActivityUpdaterListener;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent;
 use PHPUnit\Framework\MockObject\MockObject;
 use Psr\Log\LoggerInterface;
 use Test\TestCase;
diff --git a/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php b/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php
index f11438858d7d9..96d8514da41a5 100644
--- a/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php
+++ b/apps/dav/tests/unit/Listener/CalendarContactInteractionListenerTest.php
@@ -9,9 +9,9 @@
 namespace OCA\DAV\Tests\Unit\Listener;
 
 use OCA\DAV\Connector\Sabre\Principal;
-use OCA\DAV\Events\CalendarObjectCreatedEvent;
 use OCA\DAV\Events\CalendarShareUpdatedEvent;
 use OCA\DAV\Listener\CalendarContactInteractionListener;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent;
 use OCP\Contacts\Events\ContactInteractedWithEvent;
 use OCP\EventDispatcher\Event;
 use OCP\EventDispatcher\IEventDispatcher;
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index 29da548198d27..d900941fd1a2d 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -190,6 +190,13 @@
     'OCP\\Broadcast\\Events\\IBroadcastEvent' => $baseDir . '/lib/public/Broadcast/Events/IBroadcastEvent.php',
     'OCP\\Cache\\CappedMemoryCache' => $baseDir . '/lib/public/Cache/CappedMemoryCache.php',
     'OCP\\Calendar\\BackendTemporarilyUnavailableException' => $baseDir . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
+    'OCP\\Calendar\\Events\\AbstractCalendarObjectEvent' => $baseDir . '/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectCreatedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectDeletedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectMovedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectMovedEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectMovedToTrashEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectRestoredEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php',
+    'OCP\\Calendar\\Events\\CalendarObjectUpdatedEvent' => $baseDir . '/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php',
     'OCP\\Calendar\\Exceptions\\CalendarException' => $baseDir . '/lib/public/Calendar/Exceptions/CalendarException.php',
     'OCP\\Calendar\\IAvailabilityResult' => $baseDir . '/lib/public/Calendar/IAvailabilityResult.php',
     'OCP\\Calendar\\ICalendar' => $baseDir . '/lib/public/Calendar/ICalendar.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index d9451e5294f08..36886be53f3f8 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -239,6 +239,13 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
         'OCP\\Broadcast\\Events\\IBroadcastEvent' => __DIR__ . '/../../..' . '/lib/public/Broadcast/Events/IBroadcastEvent.php',
         'OCP\\Cache\\CappedMemoryCache' => __DIR__ . '/../../..' . '/lib/public/Cache/CappedMemoryCache.php',
         'OCP\\Calendar\\BackendTemporarilyUnavailableException' => __DIR__ . '/../../..' . '/lib/public/Calendar/BackendTemporarilyUnavailableException.php',
+        'OCP\\Calendar\\Events\\AbstractCalendarObjectEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectCreatedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectMovedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectMovedEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectMovedToTrashEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectRestoredEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php',
+        'OCP\\Calendar\\Events\\CalendarObjectUpdatedEvent' => __DIR__ . '/../../..' . '/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php',
         'OCP\\Calendar\\Exceptions\\CalendarException' => __DIR__ . '/../../..' . '/lib/public/Calendar/Exceptions/CalendarException.php',
         'OCP\\Calendar\\IAvailabilityResult' => __DIR__ . '/../../..' . '/lib/public/Calendar/IAvailabilityResult.php',
         'OCP\\Calendar\\ICalendar' => __DIR__ . '/../../..' . '/lib/public/Calendar/ICalendar.php',
diff --git a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php b/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php
similarity index 57%
rename from apps/dav/lib/Events/CalendarObjectCreatedEvent.php
rename to lib/public/Calendar/Events/AbstractCalendarObjectEvent.php
index 187ded2dcd4f9..111ed096f78e7 100644
--- a/apps/dav/lib/Events/CalendarObjectCreatedEvent.php
+++ b/lib/public/Calendar/Events/AbstractCalendarObjectEvent.php
@@ -3,29 +3,25 @@
 declare(strict_types=1);
 
 /**
- * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
  * SPDX-License-Identifier: AGPL-3.0-or-later
  */
-namespace OCA\DAV\Events;
+namespace OCP\Calendar\Events;
 
 use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IWebhookCompatibleEvent;
 
 /**
- * Class CalendarObjectCreatedEvent
- *
- * @package OCA\DAV\Events
- * @since 20.0.0
+ * @since 32.0.0
  */
-class CalendarObjectCreatedEvent extends Event {
+abstract class AbstractCalendarObjectEvent extends Event implements IWebhookCompatibleEvent {
 
 	/**
-	 * CalendarObjectCreatedEvent constructor.
-	 *
 	 * @param int $calendarId
 	 * @param array $calendarData
 	 * @param array $shares
 	 * @param array $objectData
-	 * @since 20.0.0
+	 * @since 32.0.0
 	 */
 	public function __construct(
 		private int $calendarId,
@@ -38,7 +34,7 @@ public function __construct(
 
 	/**
 	 * @return int
-	 * @since 20.0.0
+	 * @since 32.0.0
 	 */
 	public function getCalendarId(): int {
 		return $this->calendarId;
@@ -46,7 +42,7 @@ public function getCalendarId(): int {
 
 	/**
 	 * @return array
-	 * @since 20.0.0
+	 * @since 32.0.0
 	 */
 	public function getCalendarData(): array {
 		return $this->calendarData;
@@ -54,7 +50,7 @@ public function getCalendarData(): array {
 
 	/**
 	 * @return array
-	 * @since 20.0.0
+	 * @since 32.0.0
 	 */
 	public function getShares(): array {
 		return $this->shares;
@@ -62,9 +58,22 @@ public function getShares(): array {
 
 	/**
 	 * @return array
-	 * @since 20.0.0
+	 * @since 32.0.0
 	 */
 	public function getObjectData(): array {
 		return $this->objectData;
 	}
+
+	/**
+	 * @return array
+	 * @since 32.0.0
+	 */
+	public function getWebhookSerializable(): array {
+		return [
+			'calendarId' => $this->getCalendarId(),
+			'calendarData' => $this->getCalendarData(),
+			'shares' => $this->getShares(),
+			'objectData' => $this->getObjectData(),
+		];
+	}
 }
diff --git a/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php b/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php
new file mode 100644
index 0000000000000..a4d0f40ec5551
--- /dev/null
+++ b/lib/public/Calendar/Events/CalendarObjectCreatedEvent.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Calendar\Events;
+
+/**
+ * @since 32.0.0
+ */
+class CalendarObjectCreatedEvent extends AbstractCalendarObjectEvent {
+}
diff --git a/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php b/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php
new file mode 100644
index 0000000000000..5466213584e97
--- /dev/null
+++ b/lib/public/Calendar/Events/CalendarObjectDeletedEvent.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Calendar\Events;
+
+/**
+ * @since 32.0.0
+ */
+class CalendarObjectDeletedEvent extends AbstractCalendarObjectEvent {
+}
diff --git a/apps/dav/lib/Events/CalendarObjectMovedEvent.php b/lib/public/Calendar/Events/CalendarObjectMovedEvent.php
similarity index 58%
rename from apps/dav/lib/Events/CalendarObjectMovedEvent.php
rename to lib/public/Calendar/Events/CalendarObjectMovedEvent.php
index 0b57919ddc9f3..1c7df0e1ed589 100644
--- a/apps/dav/lib/Events/CalendarObjectMovedEvent.php
+++ b/lib/public/Calendar/Events/CalendarObjectMovedEvent.php
@@ -3,22 +3,20 @@
 declare(strict_types=1);
 
 /**
- * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
  * SPDX-License-Identifier: AGPL-3.0-or-later
  */
-namespace OCA\DAV\Events;
+namespace OCP\Calendar\Events;
 
 use OCP\EventDispatcher\Event;
+use OCP\EventDispatcher\IWebhookCompatibleEvent;
 
 /**
- * Class CalendarObjectMovedEvent
- *
- * @package OCA\DAV\Events
- * @since 25.0.0
+ * @since 32.0.0
  */
-class CalendarObjectMovedEvent extends Event {
+class CalendarObjectMovedEvent extends Event implements IWebhookCompatibleEvent {
 	/**
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function __construct(
 		private int $sourceCalendarId,
@@ -34,7 +32,7 @@ public function __construct(
 
 	/**
 	 * @return int
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getSourceCalendarId(): int {
 		return $this->sourceCalendarId;
@@ -42,7 +40,7 @@ public function getSourceCalendarId(): int {
 
 	/**
 	 * @return array
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getSourceCalendarData(): array {
 		return $this->sourceCalendarData;
@@ -50,7 +48,7 @@ public function getSourceCalendarData(): array {
 
 	/**
 	 * @return int
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getTargetCalendarId(): int {
 		return $this->targetCalendarId;
@@ -58,7 +56,7 @@ public function getTargetCalendarId(): int {
 
 	/**
 	 * @return array
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getTargetCalendarData(): array {
 		return $this->targetCalendarData;
@@ -66,7 +64,7 @@ public function getTargetCalendarData(): array {
 
 	/**
 	 * @return array
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getSourceShares(): array {
 		return $this->sourceShares;
@@ -74,7 +72,7 @@ public function getSourceShares(): array {
 
 	/**
 	 * @return array
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getTargetShares(): array {
 		return $this->targetShares;
@@ -82,9 +80,25 @@ public function getTargetShares(): array {
 
 	/**
 	 * @return array
-	 * @since 25.0.0
+	 * @since 32.0.0
 	 */
 	public function getObjectData(): array {
 		return $this->objectData;
 	}
+
+	/**
+	 * @return array
+	 * @since 32.0.0
+	 */
+	public function getWebhookSerializable(): array {
+		return [
+			'sourceCalendarId' => $this->getSourceCalendarId(),
+			'sourceCalendarData' => $this->getSourceCalendarData(),
+			'targetCalendarId' => $this->getTargetCalendarId(),
+			'targetCalendarData' => $this->getTargetCalendarData(),
+			'sourceShares' => $this->getSourceShares(),
+			'targetShares' => $this->getTargetShares(),
+			'objectData' => $this->getObjectData(),
+		];
+	}
 }
diff --git a/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php b/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php
new file mode 100644
index 0000000000000..ffbd7b0375a8f
--- /dev/null
+++ b/lib/public/Calendar/Events/CalendarObjectMovedToTrashEvent.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Calendar\Events;
+
+/**
+ * @since 32.0.0
+ */
+class CalendarObjectMovedToTrashEvent extends AbstractCalendarObjectEvent {
+}
diff --git a/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php b/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php
new file mode 100644
index 0000000000000..7890e3ca5b35e
--- /dev/null
+++ b/lib/public/Calendar/Events/CalendarObjectRestoredEvent.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Calendar\Events;
+
+/**
+ * @since 32.0.0
+ */
+class CalendarObjectRestoredEvent extends AbstractCalendarObjectEvent {
+}
diff --git a/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php b/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php
new file mode 100644
index 0000000000000..c06b2b8198ff7
--- /dev/null
+++ b/lib/public/Calendar/Events/CalendarObjectUpdatedEvent.php
@@ -0,0 +1,15 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+namespace OCP\Calendar\Events;
+
+/**
+ * @since 32.0.0
+ */
+class CalendarObjectUpdatedEvent extends AbstractCalendarObjectEvent {
+}


Reviews:
user: login: ChristophWurst
body: 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.
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-02-27T09:20:32Z
user: login: ChristophWurst
body: See above. The goal of this PR is to expose a public API, which internal events aren't.

Thanks you for you contribution
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-02-27T17:36:25Z
user: login: ChristophWurst
body: Looks good :+1: 
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-04T07:46:03Z
user: login: come-nc
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T11:31:13Z
user: login: ChristophWurst
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T14:13:08Z
user: login: edward-ly
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-06T18:12:26Z
user: login: ChristophWurst
body: Nice!
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-06T18:26:46Z
user: login: st3iny
body: We are gonna break some apps I think. But it's fine as the `OCA` stuff **is not** a public API.
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-06T19:27:01Z

Review comments:
diff_hunk: @@ -34,6 +34,12 @@
 use OCA\DAV\Events\SubscriptionDeletedEvent;
 use OCA\DAV\Events\SubscriptionUpdatedEvent;
 use OCP\AppFramework\Db\TTransactional;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent as PublicCalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent as PublicCalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent as PublicCalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent as PublicCalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent as PublicCalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent as PublicCalendarObjectUpdatedEvent;
path: apps/dav/lib/CalDAV/CalDavBackend.php
user: login: come-nc
body: Should the OCA events be deprecated then?
created_at: 2025-03-06T11:31:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -34,6 +34,12 @@
 use OCA\DAV\Events\SubscriptionDeletedEvent;
 use OCA\DAV\Events\SubscriptionUpdatedEvent;
 use OCP\AppFramework\Db\TTransactional;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent as PublicCalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent as PublicCalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent as PublicCalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent as PublicCalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent as PublicCalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent as PublicCalendarObjectUpdatedEvent;
path: apps/dav/lib/CalDAV/CalDavBackend.php
user: login: ChristophWurst
body: Either that or moving the events from OCA to OCP. Deprecation shouldn't be necessary for internal APIs.
created_at: 2025-03-06T14:13:08Z
author_association: MEMBER
diff_hunk: @@ -34,6 +34,12 @@
 use OCA\DAV\Events\SubscriptionDeletedEvent;
 use OCA\DAV\Events\SubscriptionUpdatedEvent;
 use OCP\AppFramework\Db\TTransactional;
+use OCP\Calendar\Events\CalendarObjectCreatedEvent as PublicCalendarObjectCreatedEvent;
+use OCP\Calendar\Events\CalendarObjectDeletedEvent as PublicCalendarObjectDeletedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedEvent as PublicCalendarObjectMovedEvent;
+use OCP\Calendar\Events\CalendarObjectMovedToTrashEvent as PublicCalendarObjectMovedToTrashEvent;
+use OCP\Calendar\Events\CalendarObjectRestoredEvent as PublicCalendarObjectRestoredEvent;
+use OCP\Calendar\Events\CalendarObjectUpdatedEvent as PublicCalendarObjectUpdatedEvent;
path: apps/dav/lib/CalDAV/CalDavBackend.php
user: login: edward-ly
body: OCA events have now been moved.
created_at: 2025-03-06T18:12:26Z
author_association: CONTRIBUTOR

PR comments:
user: login: edward-ly
created_at: 2025-02-27T17:00:22Z
body: > 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 `OCP\Calendar\Events` and creating new events that extend the private ones be a viable solution?

EDIT: actually, in the [webhook listeners documentation](https://docs.nextcloud.com/server/latest/admin_manual/webhook_listeners/index.html#nextcloud-webhook-events), there are some webhook events that are still in the OCA namespace, so I'm not sure if the workaround is really necessary.
author_association: CONTRIBUTOR
user: login: ChristophWurst
created_at: 2025-02-27T17:34:54Z
body: > EDIT: actually, in the [webhook listeners documentation](https://docs.nextcloud.com/server/latest/admin_manual/webhook_listeners/index.html#nextcloud-webhook-events), 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.
author_association: MEMBER
user: login: AndyScherzinger
created_at: 2025-02-28T13:19:31Z
body: /backport to stable31
author_association: MEMBER
user: login: ChristophWurst
created_at: 2025-02-28T13:31:13Z
body: @AndyScherzinger are we backporting new APIs for this?
author_association: MEMBER
user: login: AndyScherzinger
created_at: 2025-02-28T15:42:53Z
body: In this case yes, else the customer needs to wait until v32 enterprise. 
author_association: MEMBER
user: login: edward-ly
created_at: 2025-03-03T16:12:34Z
body: I think I have everything setup now, but let me know if I'm missing anything.
author_association: CONTRIBUTOR
user: login: tcitworld
created_at: 2025-03-04T08:45:26Z
body: 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.
author_association: MEMBER
user: login: ChristophWurst
created_at: 2025-03-04T09:01:53Z
body: I'm not sure I get your message. Do you mean also moving/exposing the other calendar events?
author_association: MEMBER
user: login: tcitworld
created_at: 2025-03-04T09:39:51Z
body: Yup.
author_association: MEMBER
user: login: ChristophWurst
created_at: 2025-03-04T16:00:34Z
body: Makes sense, yes
author_association: MEMBER
user: login: edward-ly
created_at: 2025-03-04T16:39:59Z
body: Added the remaining events for the calendar objects now, will get to the documentation shortly.
author_association: CONTRIBUTOR
user: login: come-nc
created_at: 2025-03-10T09:04:31Z
body: > We are gonna break some apps I think. But it's fine as the `OCA` stuff **is not** a public API.

Still, make sure that it’s part of the ugrade guide for apps.
author_association: CONTRIBUTOR
user: login: tcitworld
created_at: 2025-03-10T09:31:50Z
body: Seeing this remark on the above mentioned issue by @JonathanTreffler 

> it is a bit weird to have such generically named public events, that are actually fixed to the default calendar backend and therefore not as generic as the name would suggest

That's correct, OCP events should be able to be emitted by any app (not just `DAV\CalendarBackend`). To distinguish between those, maybe we should reference the calendar provider class inside events as well?
author_association: MEMBER
user: login: come-nc
created_at: 2025-03-10T17:06:47Z
body: > Seeing this remark on the above mentioned issue by @JonathanTreffler
> 
> > it is a bit weird to have such generically named public events, that are actually fixed to the default calendar backend and therefore not as generic as the name would suggest

Is that theoritical or are there other calendar backends out there?
Why would another calendar backend not fire the OCP events?

author_association: CONTRIBUTOR
user: login: ChristophWurst
created_at: 2025-03-10T17:11:44Z
body: > 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.
author_association: MEMBER
user: login: JonathanTreffler
created_at: 2025-03-10T17:16:56Z
body: > Is that theoritical or are there other calendar backends out there?

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)
author_association: NONE
user: login: JonathanTreffler
created_at: 2025-03-10T17:26:55Z
body: > Why would another calendar backend not fire the OCP events?

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 :laughing: ).

(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))
author_association: NONE
user: login: AndyScherzinger
created_at: 2025-03-10T20:47:31Z
body: Hi @JonathanTreffler not sure if it went unnoticed but due to https://github.com/nextcloud/server/pull/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 
author_association: MEMBER
user: login: JonathanTreffler
created_at: 2025-03-10T21:08:54Z
body: > Hi @JonathanTreffler not sure if it went unnoticed but due to https://github.com/nextcloud/server/pull/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.
author_association: NONE
user: login: AndyScherzinger
created_at: 2025-03-10T22:35:27Z
body: Thanks for the feedback @JonathanTreffler and glad to know you would have a way to work around this API challenge 🙏
author_association: MEMBER
user: login: AndyScherzinger
created_at: 2025-03-10T22:36:09Z
body: Backport is not yet merged and shall not be merged this week to it won't be in the March maintenance releases. 
author_association: MEMBER
user: login: nickvergessen
created_at: 2025-03-11T12:38:22Z
body: > We are gonna break some apps I think.

Add Talk to the list and one of my community apps.

> But it's fine as the OCA stuff is not a public API.

I still disagree in this case. From my POV events are "public API" unless explicitly mentioned otherwise, it was not mentioned on those events.
Additionally it would have been close to zero additional effort to just emit the old and new events in parallel (especially as we backport into a released major), or am I missing something?
author_association: MEMBER
user: login: nickvergessen
created_at: 2025-03-11T12:43:08Z
body: I will try that later today, to prevent the BC break and therefore patch-version depending from other apps.
author_association: MEMBER