Skip to content
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(dav): Fix atomic addressbook update #43903

Merged
merged 1 commit into from
Mar 5, 2024

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Feb 29, 2024

Summary

Sabre executes the proppatch callback after calling updateAddressbook and not synchronously. That means the code inside the callback was run outside a database transaction. This moves the atomic helper into the callback to create the expected transaction span.

A fine detail we have missed in #36528. We probably have to check the CalDAV backend too. #43904

tl;dr: see https://github.com/nextcloud/server/pull/43903/files?w=1

Checklist

Sabre executes the proppatch callback *after* calling updateAddressbook
and not synchronously. That means the code inside the callback was run
outside a database transaction. This moves the atomic helper into the
callback to create the expected transaction span.

Signed-off-by: Christoph Wurst <[email protected]>
$updates['description'] = $newValue;
break;
}
$propPatch->handle($supportedProperties, function ($mutations) use ($addressBookId) {

Check notice

Code scanning / Psalm

MissingClosureParamType Note

Parameter $mutations has no provided type
return true;
});
}, $this->db);
$this->dispatcher->dispatchTyped(new AddressBookUpdatedEvent((int)$addressBookId, $addressBookRow, $shares, $mutations));

Check notice

Code scanning / Psalm

PossiblyNullArgument Note

Argument 2 of OCA\DAV\Events\AddressBookUpdatedEvent::__construct cannot be null, possibly null value provided
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skjnldsv skjnldsv merged commit 65a0583 into master Mar 5, 2024
160 checks passed
@skjnldsv skjnldsv deleted the fix/dav/dirty-address-book-update branch March 5, 2024 21:00
@blizzz blizzz mentioned this pull request Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug feature: carddav Related to CardDAV internals feature: dav
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants