-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix sync errors for card creation with the same uri from different sources #32057
Fix sync errors for card creation with the same uri from different sources #32057
Conversation
@skjnldsv could you check this branch out and re- test it on your setup please? |
4228fc5
to
2f39ea2
Compare
/rebase |
2f39ea2
to
2326a12
Compare
This integration test fails:
@ChristophWurst do you know how to fix this? I have never written tests like these before |
/rebase |
2326a12
to
7c5d76d
Compare
The UID is matching for the backend - search term "user" and uid "users:foo-baz-bar" Since the VCard rfc doesn't explicitly specify a format, I will md5 hash the composite uid value to obscure the backend name for the search. this doesn't need to be cryptographically safe. |
@@ -274,7 +274,7 @@ | |||
$allCards = $this->backend->getCards($systemAddressBook['id']); | |||
foreach ($allCards as $card) { | |||
$vCard = Reader::read($card['carddata']); | |||
$uid = $vCard->UID->getValue(); | |||
$uid = isset($vCard->{'X-NEXTCLOUD-UID'}) ? $vCard->{'X-NEXTCLOUD-UID'}->getValue() : $vCard->UID->getValue(); |
Check notice
Code scanning / Psalm
PossiblyNullReference
/rebase |
…ackends Signed-off-by: Anna Larch <anna@nextcloud.com>
fa2a52f
to
ddcee3d
Compare
Drone failure unrelated:
|
However this is not unrelated:
|
Also this is a breaking change for |
This restores the previous behaviour from before #32057 Signed-off-by: Joas Schilling <coding@schilljs.com>
Restored the original content (userid) of |
Reverted in #36131 Also the sync service assumed the UID is the user id: server/apps/dav/lib/CardDAV/SyncService.php Lines 273 to 282 in e6f4705
|
When syncing the system address book,, the email address is used as the uri.
This leads to errors when two different backends are providing the same email addresses and try to create VCards for those entries separately.
Since the code should not be forced to decide which data providing backend is the source of truth, the uri should include the backend identifier to make uris more unique and dependent on their source.