Fix removed address book items not being synced between federated instances#59312
Fix removed address book items not being synced between federated instances#59312icewind1991 merged 6 commits intomasterfrom
Conversation
| // when doing a full sync, remove any items in the local address book that aren't in the remote one | ||
| if (!$syncToken) { | ||
| $existingCards = $this->backend->getCards($addressBookId); | ||
| $removedCards = array_filter($existingCards, fn (array $card) => !in_array($card['uri'], $received)); |
There was a problem hiding this comment.
Premature approval,
This logic doesn't work in case of truncation, not all the cards are received at each step
There was a problem hiding this comment.
Changed it to "mark" all cards at the start of the sync by setting the mtime to null, then at the end delete all cards that haven't been touched by the sync.
85aba8b to
93fe7e3
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
…a sync Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
93fe7e3 to
fc11eef
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
|
Fixed an issue with the limit handling of the initial sync where because of a missing ordering some items could be skipped. |
| $syncToken = $oldSyncToken; | ||
| $syncToken = $full ? null : $oldSyncToken; | ||
|
|
||
| $book = $this->syncService->ensureSystemAddressBookExists($targetPrincipal, $targetBookId, $targetBookProperties); |
There was a problem hiding this comment.
Causes a redundant call inside https://github.com/nextcloud/server/blob/master/apps/dav/lib/CardDAV/SyncService.php#L51
Maybe it should be removed inside syncRemoteAddressBook and we pass the addressbook as a parameter ?
|
/backport to stable33 |
|
/backport to stable32 |
|
/backport to stable31 |
Currently deleted address book items aren't send in the sync
REPORTresponse.This adds the removed items to the
REPORTresponse.Additionally it adds a
--fulloption to theocc federation:sync-addressbookscommand to allow fixing existing cases of deletes not being synced.