Skip to content

Commit 91bc886

Browse files
committed
fixup! feat(cardav): support result truncation for addressbook federation
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
1 parent 9099b1e commit 91bc886

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

apps/dav/lib/CardDAV/CardDavBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -852,7 +852,7 @@ public function deleteCard($addressBookId, $cardUri) {
852852
* @return array
853853
*/
854854
public function getChangesForAddressBook($addressBookId, $syncToken, $syncLevel, $limit = null) {
855-
$maxLimit = $this->config->getSystemValueInt('carddav_sync_request_truncation', 50000);
855+
$maxLimit = $this->config->getSystemValueInt('carddav_sync_request_truncation', 2500);
856856
$limit = ($limit === null) ? $maxLimit : min($limit, $maxLimit);
857857
// Current synctoken
858858
return $this->atomic(function () use ($addressBookId, $syncToken, $syncLevel, $limit) {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function testEmptySync(): void {
108108
'1',
109109
'principals/system/system',
110110
[]
111-
);
111+
)['token'];
112112

113113
$this->assertEquals('http://sabre.io/ns/sync/1', $token);
114114
}
@@ -179,7 +179,7 @@ public function testSyncWithNewElement(): void {
179179
'1',
180180
'principals/system/system',
181181
[]
182-
);
182+
)['token'];
183183

184184
$this->assertEquals('http://sabre.io/ns/sync/2', $token);
185185
}
@@ -250,7 +250,7 @@ public function testSyncWithUpdatedElement(): void {
250250
'1',
251251
'principals/system/system',
252252
[]
253-
);
253+
)['token'];
254254

255255
$this->assertEquals('http://sabre.io/ns/sync/3', $token);
256256
}
@@ -291,7 +291,7 @@ public function testSyncWithDeletedElement(): void {
291291
'1',
292292
'principals/system/system',
293293
[]
294-
);
294+
)['token'];
295295

296296
$this->assertEquals('http://sabre.io/ns/sync/4', $token);
297297
}
@@ -422,7 +422,7 @@ public function testDeleteAddressbookWhenAccessRevoked(): void {
422422
'1',
423423
'principals/system/system',
424424
[]
425-
);
425+
)['token'];
426426
}
427427

428428
#[\PHPUnit\Framework\Attributes\DataProvider('providerUseAbsoluteUriReport')]
@@ -462,7 +462,7 @@ public function testUseAbsoluteUriReport(string $host, string $expected): void {
462462
'1',
463463
'principals/system/system',
464464
[]
465-
);
465+
)['token'];
466466
}
467467

468468
public static function providerUseAbsoluteUriReport(): array {

config/config.sample.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@
357357
/**
358358
* The limit applied to the synchronization report request, e.g. federated system address books (as run by `occ federation:sync-addressbooks`).
359359
*/
360-
'carddav_sync_request_truncation' => 50000,
360+
'carddav_sync_request_truncation' => 2500,
361361

362362
/**
363363
* `true` enables a relaxed session timeout, where the session timeout would no longer be

0 commit comments

Comments
 (0)