Skip to content

Conversation

@backportbot-nextcloud
Copy link

Backport of #39202

blizzz added 13 commits July 7, 2023 14:54
- uses DAV search approach against valid files joined by systemtag selector
- reduced table join for tag/systemtag search
- supports pagination
- no changes to the output formats or similar

Example request body:

<?xml version="1.0"?>
<oc:filter-files xmlns:d="DAV:" xmlns:oc="http://owncloud.org/ns" xmlns:nc="http://nextcloud.org/ns" xmlns:ocs="http://open-collaboration-services.org/ns">
  <d:prop>
    <d:getcontentlength/>
    <d:getcontenttype/>
    <d:getetag/>
    <d:getlastmodified/>
    <d:resourcetype/>
    <nc:face-detections/>
    <nc:file-metadata-size/>
    <nc:has-preview/>
    <nc:realpath/>
    <oc:favorite/>
    <oc:fileid/>
    <oc:permissions/>
    <nc:nbItems/>
  </d:prop>
  <oc:filter-rules>
    <oc:systemtag>32</oc:systemtag>
  </oc:filter-rules>
  <d:limit>
    <d:nresults>50</d:nresults>
    <nc:firstresult>0</nc:firstresult>
  </d:limit>
</oc:filter-files>

Signed-off-by: Arthur Schiwon <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
- possible null return
- parameter name mismatch in implementation
- incomplete unit test

Signed-off-by: Arthur Schiwon <[email protected]>
@backportbot-nextcloud backportbot-nextcloud bot added this to the Nextcloud 26.0.4 milestone Jul 7, 2023
@blizzz blizzz changed the title [stable26] [stable27] use more efficient tag retrieval on DAV report request [stable26] use more efficient tag retrieval on DAV report request Jul 7, 2023
@blizzz blizzz added 3. to review Waiting for reviews 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 7, 2023
- in this backport we have to drop the breaking addition in
  \OCP\Files\Folder
- this requires adjustments in check for the existance of the method but
  also in testing
- another change in \OCP\SystemTag\ISystemTagManager can be applied as
  this interface is not implemented elsewhere

Signed-off-by: Arthur Schiwon <[email protected]>
@blizzz blizzz force-pushed the backport/39202/stable26 branch from 29918ef to fc9fd0d Compare July 7, 2023 14:58
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jul 7, 2023
@blizzz blizzz requested review from a team, ArtificialOwl, come-nc and icewind1991 and removed request for a team July 7, 2023 14:59
@blizzz blizzz requested a review from marcelklehr July 7, 2023 14:59

foreach ($tags as $tag) {
$tagName = $tag->getName();
$tmpNodes = $this->userFolder->searchBySystemTag($tagName, $this->userSession->getUser()->getUID(), $dbLimit, $dbOffset);

Check notice

Code scanning / Psalm

PossiblyNullReference

Cannot call method getUID on possibly null value
// Empty intersection, nothing can show up anymore
return [];
if (!$oneTagSearch && ($limit !== null || $offset !== null)) {
$nodes = array_slice($nodes, $offset, $limit);

Check notice

Code scanning / Psalm

PossiblyNullArgument

Argument 2 of array_slice cannot be null, possibly null value provided
@blizzz blizzz mentioned this pull request Jul 10, 2023
@juliusknorr juliusknorr merged commit c7a8c3b into stable26 Jul 10, 2023
@juliusknorr juliusknorr deleted the backport/39202/stable26 branch July 10, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants