fix(dav): default calendar and address book not created on first login

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
pull/50369/head
Richard Steinmetz 12 months ago
parent c28464ef0d
commit d3126cd1bb
No known key found for this signature in database
GPG Key ID: 27137D9E7D273FB2
  1. 2
      apps/dav/lib/AppInfo/Application.php
  2. 5
      build/integration/dav_features/caldav.feature
  3. 4
      build/integration/dav_features/carddav.feature

@ -81,6 +81,7 @@ use OCP\Config\BeforePreferenceDeletedEvent;
use OCP\Config\BeforePreferenceSetEvent; use OCP\Config\BeforePreferenceSetEvent;
use OCP\Contacts\IManager as IContactsManager; use OCP\Contacts\IManager as IContactsManager;
use OCP\DB\Events\AddMissingIndicesEvent; use OCP\DB\Events\AddMissingIndicesEvent;
use OCP\EventDispatcher\GenericEvent;
use OCP\EventDispatcher\IEventDispatcher; use OCP\EventDispatcher\IEventDispatcher;
use OCP\Federation\Events\TrustedServerRemovedEvent; use OCP\Federation\Events\TrustedServerRemovedEvent;
use OCP\Files\AppData\IAppDataFactory; use OCP\Files\AppData\IAppDataFactory;
@ -91,7 +92,6 @@ use OCP\User\Events\OutOfOfficeClearedEvent;
use OCP\User\Events\OutOfOfficeScheduledEvent; use OCP\User\Events\OutOfOfficeScheduledEvent;
use Psr\Container\ContainerInterface; use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\GenericEvent;
use Throwable; use Throwable;
use function is_null; use function is_null;

@ -87,3 +87,8 @@ Feature: caldav
When "user0" requests principal "users/user0" on the endpoint "/remote.php/dav/principals/" When "user0" requests principal "users/user0" on the endpoint "/remote.php/dav/principals/"
Then The CalDAV response should be multi status Then The CalDAV response should be multi status
And The CalDAV response should contain a property "{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL" with a href value "/remote.php/dav/calendars/user0/MyCalendar2/" And The CalDAV response should contain a property "{urn:ietf:params:xml:ns:caldav}schedule-default-calendar-URL" with a href value "/remote.php/dav/calendars/user0/MyCalendar2/"
Scenario: Should create default calendar on first login
Given user "first-login" exists
When "first-login" requests calendar "first-login/personal" on the endpoint "/remote.php/dav/calendars/"
Then The CalDAV HTTP status code should be "207"

@ -79,3 +79,7 @@ Feature: carddav
Then The CardDAV HTTP status code should be "404" Then The CardDAV HTTP status code should be "404"
And The CardDAV exception is "Sabre\DAV\Exception\NotFound" And The CardDAV exception is "Sabre\DAV\Exception\NotFound"
And The CardDAV error message is "File not found: admin in 'addressbooks'" And The CardDAV error message is "File not found: admin in 'addressbooks'"
Scenario: Should create default addressbook on first login
Given user "first-login" exists
Then "first-login" requests addressbook "first-login/contacts" with statuscode "207" on the endpoint "/remote.php/dav/addressbooks/users/"

Loading…
Cancel
Save