Skip to content

Commit 840cf57

Browse files
CarlSchwannextcloud-command
authored andcommitted
Merge branch 'master' into dependabot/npm_and_yarn/follow-redirects-1.16.0
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2 parents 66585fc + 2ee2356 commit 840cf57

82 files changed

Lines changed: 154 additions & 543 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/dav/lib/CardDAV/SyncService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,10 @@ public function syncInstance(?\Closure $progressCallback = null) {
201201
$vCard = Reader::read($card['carddata']);
202202
$uid = $vCard->UID->getValue();
203203
// load backend and see if user exists
204-
if (!$this->userManager->userExists($uid)) {
204+
$user = $this->userManager->get($uid);
205+
206+
// If the user does not exist
207+
if ($user === null || self::getCardUri($user) !== $card['uri']) {
205208
$this->deleteUser($card['uri']);
206209
}
207210
}

apps/dav/tests/unit/CardDAV/SyncServiceTest.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,44 @@ public function testUpdateAndDeleteUser(bool $activated, int $createCalls, int $
367367
$ss->deleteUser($user);
368368
}
369369

370+
public function testSyncInstance(): void {
371+
/** @var CardDavBackend | MockObject $backend */
372+
$backend = $this->getMockBuilder(CardDavBackend::class)->disableOriginalConstructor()->getMock();
373+
$logger = $this->getMockBuilder(LoggerInterface::class)->disableOriginalConstructor()->getMock();
374+
375+
$backend->expects($this->exactly(1))->method('deleteCard');
376+
377+
$backend->method('getCards')->willReturn([
378+
[
379+
'carddata' => "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.4.8//EN\r\nUID:test-user\r\nFN:test-user\r\nN:test-user;;;;\r\nEND:VCARD\r\n\r\n",
380+
'uri' => 'Database:test-user.vcf',
381+
],
382+
[
383+
'carddata' => "BEGIN:VCARD\r\nVERSION:3.0\r\nPRODID:-//Sabre//Sabre VObject 3.4.8//EN\r\nUID:test-user\r\nFN:test-user\r\nN:test-user;;;;\r\nEND:VCARD\r\n\r\n",
384+
'uri' => 'LDAP:test-user.vcf',
385+
],
386+
]
387+
);
388+
389+
$backend->method('getAddressBooksByUri')
390+
->with('principals/system/system', 'system')
391+
->willReturn(['id' => -1]);
392+
393+
$userManager = $this->createMock(IUserManager::class);
394+
$dbConnection = $this->createMock(IDBConnection::class);
395+
$user = $this->createMock(IUser::class);
396+
$user->method('getBackendClassName')->willReturn('LDAP');
397+
$user->method('getUID')->willReturn('test-user');
398+
$userManager->method('get')->willReturn($user);
399+
400+
$converter = $this->createMock(Converter::class);
401+
$clientService = $this->createMock(IClientService::class);
402+
$config = $this->createMock(IConfig::class);
403+
404+
$ss = new SyncService($clientService, $config, $backend, $userManager, $dbConnection, $logger, $converter);
405+
$ss->syncInstance();
406+
}
407+
370408
public function testDeleteAddressbookWhenAccessRevoked(): void {
371409
$this->expectException(ClientExceptionInterface::class);
372410

build/frontend-legacy/package-lock.json

Lines changed: 11 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/1140-1140.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ This file is generated from multiple sources. Included packages:
147147
- version: 3.5.28
148148
- license: MIT
149149
- axios
150-
- version: 1.13.5
150+
- version: 1.15.0
151151
- license: MIT
152152
- base64-js
153153
- version: 1.5.1

dist/1216-1216.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ This file is generated from multiple sources. Included packages:
5757
- version: 11.3.0
5858
- license: MIT
5959
- axios
60-
- version: 1.13.5
60+
- version: 1.15.0
6161
- license: MIT
6262
- base64-js
6363
- version: 1.5.1

dist/1598-1598.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ This file is generated from multiple sources. Included packages:
159159
- version: 11.3.0
160160
- license: MIT
161161
- axios
162-
- version: 1.13.5
162+
- version: 1.15.0
163163
- license: MIT
164164
- base64-js
165165
- version: 1.5.1

dist/1764-1764.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ This file is generated from multiple sources. Included packages:
9393
- version: 4.5.0
9494
- license: Apache-2.0
9595
- axios
96-
- version: 1.13.5
96+
- version: 1.15.0
9797
- license: MIT
9898
- base64-js
9999
- version: 1.5.1

dist/1930-1930.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This file is generated from multiple sources. Included packages:
7171
- version: 11.3.0
7272
- license: MIT
7373
- axios
74-
- version: 1.13.5
74+
- version: 1.15.0
7575
- license: MIT
7676
- base64-js
7777
- version: 1.5.1

dist/2311-2311.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ This file is generated from multiple sources. Included packages:
6464
- version: 11.3.0
6565
- license: MIT
6666
- axios
67-
- version: 1.13.5
67+
- version: 1.15.0
6868
- license: MIT
6969
- base64-js
7070
- version: 1.5.1

dist/2426-2426.js.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ This file is generated from multiple sources. Included packages:
109109
- version: 8.37.0
110110
- license: AGPL-3.0-or-later
111111
- axios
112-
- version: 1.13.5
112+
- version: 1.15.0
113113
- license: MIT
114114
- base64-js
115115
- version: 1.5.1

0 commit comments

Comments
 (0)