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

only return rich workspace when depth is 1 or greater #994

Merged
merged 1 commit into from
Sep 1, 2020
Merged

only return rich workspace when depth is 1 or greater #994

merged 1 commit into from
Sep 1, 2020

Conversation

dassio
Copy link
Contributor

@dassio dassio commented Aug 28, 2020

  • Resolves: #
  • Target version: master

Summary

the android app folder request is like the following:

192.168.100.10 - danny [27/Aug/2020:20:28:55 +0000] "PROPFIND /remote.php/webdav/test_pictures/ HTTP/1.1" 504 160 "-" "Mozilla/5.0 (Android) Nextcloud-android/20200821" 60.001 

"req_header:"

host: 192.168.100.62
cookie: __Host-nc_sameSiteCookielax=true; __Host-nc_sameSiteCookiestrict=true; oc_sessionPassphrase=428y0C%2BAJYvfcgy6BE%2BxzCYtR0KVCB2ecibPGF2KMgs%2BVhBP%2BELw2PyIw5UkBdX04l%2BE7oaRxR%2BRKDtJqR5BD1Komj1zRzKU%2Bd0MvhSNwwzsxN3Vvi4xs4jgkoce30tf; ocf6hkhrls8q=tr7a4m80nudm0n9ie74u51o1nd
content-type: text/xml; charset=UTF-8
content-length: 789
user-agent: Mozilla/5.0 (Android) Nextcloud-android/20200821
depth: 1
authorization: Basic ZGFubnk6RE5CQWFybE5iRGZkMVgyeVdEdlVXbURMMk5XYmNrOFE2TDd5T2NacHNSMUVPZFZvd094U3htUXdqT0JtMkdneWU3VzFwVzNW

" req_body:"

<?xml version="1.0" encoding="UTF-8"?>
<D:propfind xmlns:D="DAV:">
    <D:prop>
        <owner-id xmlns="http://owncloud.org/ns" />
        <D:creationdate />
        <D:getetag />
        <permissions xmlns="http://owncloud.org/ns" />
        <D:getlastmodified />
        <id xmlns="http://owncloud.org/ns" />
        <D:getcontentlength />
        <favorite xmlns="http://owncloud.org/ns" />
        <D:resourcetype />
        <sharees xmlns="http://nextcloud.org/ns" />
        <mount-type xmlns="http://nextcloud.org/ns" />
        <rich-workspace xmlns="http://nextcloud.org/ns" />
        <D:displayname />
        <note xmlns="http://nextcloud.org/ns" />
        <D:getcontenttype />
        <has-preview xmlns="http://nextcloud.org/ns" />
        <size xmlns="http://owncloud.org/ns" />
        <is-encrypted xmlns="http://nextcloud.org/ns" />
        <owner-display-name xmlns="http://owncloud.org/ns" />
        <comments-unread xmlns="http://owncloud.org/ns" />
    </D:prop>
</D:propfind>


" resp_header:"

content-length: 160
content-type: text/html
connection: keep-alive

" resp_body:"

<html>
    <head>
        <title>504 Gateway Time-out</title>
    </head>
    <body>
        <center>
            <h1>504 Gateway Time-out</h1>
        </center>
        <hr>
            <center>nginx</center>
    </body>
</html>

by default: depth:1 and include rich-workspace tag, this will result in nextcloud checking rich workspace for every subfolder within the requested folder, in this request it is test_pictures.

here is the folder structure:

.
├── xxx
├── xx
├── xxxx
├── xxx
├── xxxx
├── xxxx-xx
├── xx-xx
├── xxx
├── xxx
├── xx expo
├── xxx
├── xxxx
├── xx test result
├── xx
├── xx
├── xx
├── xxxxxxx照
├── xx
├── xxxxxx
├── xxx
├── xxxxx
└── xxxxx

22 directories, 0 files

in each of the folder, there could be hundreads of files, it take some time to find the README.txt file. multiply this time for each of the 22 folders, i always get a timeout.

since the rich workspace file is for current folder, i don't see the necissity to get all of this for each subfolder , in the brower, they get this specifically using https://localhost/ocs/v2.php/apps/text/workspace?path=/Photos

@dassio
Copy link
Contributor Author

dassio commented Aug 28, 2020

@juliushaertl , please help to review

@juliushaertl
Copy link
Member

Makes sense 👍 Mind to rebase on top of the latest master?

@tobiasKaminsky FYI

@juliushaertl juliushaertl added 2. developing bug Something isn't working labels Aug 31, 2020
@juliushaertl
Copy link
Member

/backport to stable19

@juliushaertl
Copy link
Member

/backport to stable18

return $file->getContent();
}
} catch (StorageNotAvailableException $e) {
if ($propFind->getDepth() > 0){
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if ($propFind->getDepth() > 0){
if ($propFind->getDepth() > 0) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok


}
}
return "";
Copy link
Member

Choose a reason for hiding this comment

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

Please keep the rest as before, we use single quotes all over the place in Nextcloud.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants