Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-30219

Fix re-indexing of proxy when parent folder of target document is moved to the trash

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Proxies are reindexed when live document is trashed.
    • Backlog priority:
      750
    • Sprint:
      nxplatform #36
    • Story Points:
      3

      Description

      When the parent folder of a document is moved to the trash, any proxy pointing to the document is not re-indexed in elasticsearch, therefore still reported in the VIEW tab in the Web UI.

      How to reproduce::

      • in a workspace named ws1, create a folder named livedocs and create a File document in it and retrieve its UUID (env. variable DOCID)
      • in the same workspace, create another folder named proxies and create a live proxy pointing to the File document
      • in the proxies folder, create a live proxy pointing to the File document and retrieve its UUID (env. variable PROXYDOCID):
        DOCID=xxx-xxxx-xx
        curl -su Administrator:Administrator -X POST -H'Content-Type: application/json' \
        http://localhost:8080/nuxeo/api/v1/id/$DOCID/@op/Document.CreateLiveProxy \
        -d '{
            "params": {
                "Destination Path": "/default-domain/workspaces/ws1/proxies"
            },
            "context": {}
        }' |jq
        
      • move the livedocs folder to the trash

      Expected result: the proxy is moved to the trash (ecm:isTrashed=true) in the database and elasticsearch
      Actual result: the proxy is moved to the trash (ecm:isTrashed=true) in the database but not in elasticsearch

      Check proxy's value of ecm:isTrashed in the database:

      PROXYDOCID=yyy-yyyy-yy
      curl -su Administrator:Administrator -H 'Content-Type:application/json' http://localhost:8080/nuxeo/api/v1/id/$PROXYDOCID -H'properties:*'|jq .isTrashed
      

      Check proxy's value of ecm:isTrashed in elasticsearch:

      curl -s http://localhost:9200/nuxeo/_search\?pretty=true\&q=_id:$PROXYDOCID |jq '.hits.hits[0]._source["ecm:isTrashed"]'
      

      After re-indexing folder proxies and its children documents with the following curl command, the proxy's value of ecm:isTrashed in elasticsearch is fixed:

      curl -X POST -su Administrator:Administrator -H "Content-Type:application/json" \
      -H 'X-NXRepository: default' -H 'X-NXVoidOperation: false' \
      http://localhost:8080/nuxeo/api/v1/automation/Elasticsearch.Index \
      -d '{"input":"doc:/default-domain/workspaces/ws1/proxies","params":{},"context":{}}'
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: