Skip to content

WebDav: Using "allprop" on PROPFIND does not behave as expected #11803

Closed

Description

@DecaTec

When using WebDav, the PROPFIND method is used to get a list of WebDav properties (i.e. files and folders saved in ownCloud). When using the so called "allprop" on PROPFIND, ownCloud seems not to include all properties (defined in RFC4918 "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)") in the response.

As an example: Let's assume that the "displayname" was changed on a file with a previous PROPPATCH command. Using an allprop-PROPFIND, ownCloud only returns the following properties: oc:id, oc:permissions, d:getetag, d:getlastmodified, d:resourcetype, d:quota-used-bytes, d:quota-available-bytes. According to RFC4918, an allprop-PROPFIND must return all live properties defined in the specification plus dead properties.
As a side note: d:quota-used-bytes, d:quota-available-bytes are not defined in RFC4918 and should not be part of the namespace xmlns:d="DAV:".

On the other hand: Trying to request a specific named property (in this case "displayname") with PROPFIND, the request content will look like this:

<propfind xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="DAV:"><prop><displayname /></prop></propfind>

In this case, the correct property with it's content is returned.

Is this a bug or is this behavior on allprop-PROPFIND on purpose?

ownCloud version is 7.0.2

Activity

  1. DeepDiver1975 commented on Oct 28, 2014

    @DeepDiver1975
    Contributor

    all webdav operations are handled by sabredav - summoning @evert - THX

  2. evert commented on Oct 28, 2014

    @evert

    {DAV:}allprop is kind of a bad idea. We recommend not using it at all. The only client that uses this are microsoft's clients, so we're retuning a list of properties that mostly makes sense for them. Extending the list of default properties that are returned {DAV:}allprop from there would mostly just serve to negatively affect performance for the few clients that use it.

    quota-used-bytes and quota-available-bytes are defined in RFC4331 and certainly are in the DAV: namespace, just like many other webdav extensions.

  3. PVince81 commented on Dec 15, 2014

    @PVince81
    Contributor

    From what I see in the code it seems that if no properties are given, it will default to a small set of properties: https://github.com/owncloud/core/blob/master/lib/private/connector/sabre/server.php#L175 which also seems to be in the original Sabre code: https://github.com/fruux/sabre-dav/blob/1.8/lib/Sabre/DAV/Server.php#L1497
    I found during my test here with a custom property #12862 that it doesn't return that custom property unless explicitly asked.

    So I guess like @evert said it isn't such a good idea.

    This means that I cannot add a custom property "oc:tags" for the file tags (#12856) unless we expect the clients to explicitly request it.

  4. PVince81 commented on Dec 15, 2014

    @PVince81
    Contributor

    Well at least having clients saying what they want can remove some load on the server, as requiring some props like "oc:tags" would cause an additional performance impact. So if not requested, it would save that.

    Still, I see that the code in ownCloud is still retrieving all properties from oc_properties then throwing them away again. We can probably save some PROPFIND performance here by not doing that SELECT in the first place.

  5. evert commented on Dec 15, 2014

    @evert

    I'd leave any refactoring until you upgrade to 2.x ;) property handling has changed significantly, so you'd be doing it twice.

  6. DeepDiver1975 commented on Dec 16, 2014

    @DeepDiver1975
    Contributor

    @PVince81 should we consider sabre 2.x upgrade for oc8? Just to get the base work done properly?

    Most critical will be testing of the sync algo. But this is meanwhile part of our client test matrix on jenkins.

  7. PVince81 commented on Dec 16, 2014

    @PVince81
    Contributor

    I think we'll run out of time for OC 8.0, but could work for OC 8.1.
    We could already start a branch to get an idea about how much work it would be.

  8. PVince81 commented on Feb 12, 2015

    @PVince81
    Contributor

    Upgrade to sabre 2.0 ticket here: #12876 PR here #14151

  9. PVince81 commented on Mar 9, 2015

    @PVince81
    Contributor

    Upgrade to Sabre 2.0 has been merged to master.

    The hacks that included some "oc:*" properties in "allprops" are now removed.
    All OC clients that require such attributes must request them explicitly.

    Closing.

    (also see #11803 (comment))

  10. locked as resolved and limited conversation to collaborators on Aug 13, 2019
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions