Skip to content

PROPPATCH updates same properties multiple times #32660

Closed as not planned
Closed as not planned

Description

@PVince81

Steps

  1. Create a file "proppatch.xml"
<?xml version="1.0" encoding="utf-8" ?>
<D:propertyupdate xmlns:D="DAV:"><D:set><D:prop><somename xmlns="http://example.com/alpha">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/beta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/gamma">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/delta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/epsilon">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/zeta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/eta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/theta">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/iota">manynsvalue</somename></D:prop></D:set>
<D:set><D:prop><somename xmlns="http://example.com/kappa">manynsvalue</somename></D:prop></D:set>
</D:propertyupdate>
  1. Create a folder "test"
  2. Set a breakpoint in FileCustomPropertiesBackend->updateProperties()
  3. curl -u admin:admin -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatch.xml" "http://localhost/owncloud/remote.php/webdav/test"

Expected result

Only a single call to updateProperties()

Actual

Multiple calls, despite the fact that we already have all properties in the first call.
It seems that there are as many callback as there are properties.

0  OCA\DAV\DAV\FileCustomPropertiesBackend->updateProperties() /srv/www/htdocs/owncloud/apps/dav/lib/DAV/FileCustomPropertiesBackend.php:157
1  OCA\DAV\DAV\FileCustomPropertiesBackend->OCA\DAV\DAV\{closure}() /srv/www/htdocs/owncloud/apps/dav/lib/DAV/AbstractCustomPropertiesBackend.php:206
2  Sabre\DAV\PropPatch->doCallBackMultiProp() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/PropPatch.php:317
3  Sabre\DAV\PropPatch->commit() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/PropPatch.php:245
4  OCA\DAV\Connector\Sabre\Server->updateProperties() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php:1265
5  Sabre\DAV\CorePlugin->httpPropPatch() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/CorePlugin.php:385
6  call_user_func_array:{/srv/www/htdocs/owncloud/lib/composer/sabre/event/lib/EventEmitterTrait.php:105}() /srv/www/htdocs/owncloud/lib/composer/sabre/event/lib/EventEmitterTrait.php:105
7  OCA\DAV\Connector\Sabre\Server->emit() /srv/www/htdocs/owncloud/lib/composer/sabre/event/lib/EventEmitterTrait.php:105
8  OCA\DAV\Connector\Sabre\Server->invokeMethod() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php:479
9  OCA\DAV\Connector\Sabre\Server->exec() /srv/www/htdocs/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php:254
10 require_once()  /srv/www/htdocs/owncloud/apps/dav/appinfo/v1/webdav.php:64
11 {main}          /srv/www/htdocs/owncloud/remote.php:165

Version

OC 10.0.10 RC1

Doing this could reduce performance. However, updating file properties with PROPPATCH is hopefully rare. I do wonder if mounting Webdav as Windows drive have more property updates...

Found while investigating Oracle issue: #32639 (comment)

cc @VicDeo

Activity

  1. added this to the QA milestone on Sep 10, 2018
  2. PVince81 commented on Sep 10, 2018

    @PVince81
    ContributorAuthor

    Seems that this code https://github.com/owncloud/core/blob/v10.0.10RC1/apps/dav/lib/DAV/AbstractCustomPropertiesBackend.php#L205 that calls handleRemaining is making Sabre create one callback per property instead of using a single callback for all.

    We might need to use a different approach/method here.

  3. VicDeo commented on Sep 10, 2018

    @VicDeo
    Contributor

    well, it was the same way before me

    public function propPatch($path, PropPatch $propPatch) {

  4. PVince81 commented on Sep 10, 2018

    @PVince81
    ContributorAuthor

    yeah, I also see this used that way in some Sabre's properties backend, so wonder if it's a Sabre bug...

  5. ownclouders commented on Sep 10, 2018

    @ownclouders
    Contributor

    GitMate.io thinks possibly related issues are #20661 (Update), #21366 (Update), #19642 (Can not download multiple times from public page), #14835 (Share dialog shows the same user multiple times), and #15477 (When updating).

  6. modified the milestones: QA, development on Sep 25, 2018
  7. modified the milestones: development, backlog on Oct 12, 2018
  8. DeepDiver1975 commented on Jun 19, 2026

    @DeepDiver1975
    Contributor

    🤖 Automated issue triage by Claude Code review agent.

    This issue was opened before 2020 and has had no activity since then, so we are closing it as outdated. If this is still relevant on a current ownCloud release, please reopen (or open a fresh issue) with up-to-date details — thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions