Skip to content

Commit

Permalink
fix(carddav): Handle race for SAB creation better
Browse files Browse the repository at this point in the history
* Accept non repeatable read and INSERT conflict by another read
* Handle replication edge case

Signed-off-by: Christoph Wurst <[email protected]>
  • Loading branch information
ChristophWurst committed Sep 18, 2024
1 parent 29a03ff commit 9ba2828
Show file tree
Hide file tree
Showing 2 changed files with 302 additions and 281 deletions.
3 changes: 2 additions & 1 deletion apps/dav/lib/CardDAV/CardDavBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ public function updateAddressBook($addressBookId, \Sabre\DAV\PropPatch $propPatc
* @param array $properties
* @return int
* @throws BadRequest
* @throws Exception
*/
public function createAddressBook($principalUri, $url, array $properties) {
if (strlen($url) > 255) {
Expand Down Expand Up @@ -395,7 +396,7 @@ public function createAddressBook($principalUri, $url, array $properties) {
'synctoken' => $query->createParameter('synctoken'),
])
->setParameters($values)
->execute();
->executeStatement();

$addressBookId = $query->getLastInsertId();
return [
Expand Down
Loading

0 comments on commit 9ba2828

Please sign in to comment.