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

Child path not updated when parent restored from trash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 10.10
    • Fix Version/s: 10.10-HF19, 11.1, 2021.0
    • Component/s: Core
    • Release Notes Summary:
      The path of trashed child documents is correctly restored.
    • Backlog priority:
      600
    • Team:
      PLATFORM
    • Sprint:
      nxplatform 11.1.21, nxplatform 11.1.22, nxplatform 11.1.23
    • Story Points:
      1

      Description

      This can be reproduced on nightly:

      1. create a folder named pouetFolder
      2. create a folder in it named pouetFolderChild
      3. trash pouetFolderChild
      4. trash pouetFolder
      5. After trashing the parent folder, its path is renamed and the isTrashed flag is set:
        curl -sSL -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed | jq .
        {
          "entity-type": "document",
          "repository": "default",
          "uid": "3d3e1aae-5b1c-4314-b720-10b42e8d51d5",
          "path": "/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed",
          "type": "Folder",
          "state": "project",
          "parentRef": "e4e625f9-55cb-4d8b-bb12-8e8d363447ce",
          "isCheckedOut": true,
          "isVersion": false,
          "isProxy": false,
          "changeToken": "2-0",
          "isTrashed": true,
          "title": "pouetFolder",
          "lastModified": "2019-09-11T07:54:01.837Z",
          "facets": [
            "Folderish",
            "NXTag"
          ],
          "schemas": [
            "common",
            "dublincore",
            "facetedTag"
          ]
        }
        

        And so does the child:

        curl -sSL -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed/pouetFolderChild._1568188472362_.trashed | jq .
        {
          "entity-type": "document",
          "repository": "default",
          "uid": "3ef8262d-00fa-4958-9524-58248461470f",
          "path": "/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed/pouetFolderChild._1568188472362_.trashed",
          "type": "Folder",
          "state": "project",
          "parentRef": "3d3e1aae-5b1c-4314-b720-10b42e8d51d5",
          "isCheckedOut": true,
          "isVersion": false,
          "isProxy": false,
          "changeToken": "2-0",
          "isTrashed": true,
          "title": "pouetFolderChild",
          "lastModified": "2019-09-11T07:54:17.323Z",
          "facets": [
            "Folderish",
            "NXTag"
          ],
          "schemas": [
            "common",
            "dublincore",
            "facetedTag"
          ]
        }
      6. Restore the parent pouetFolder and observe the parent's path is renamed and cannot be found by its trashed path:
        curl -sSL -u Administrator:Administrator [https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed] | jq .
        { "entity-type": "exception", "status": 404, "message": "/default-domain/workspaces/pouetSpace/pouetFolder._1568188481461_.trashed" }
        

        But only by its original path:

        curl -sSL -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder | jq .
        {
          "entity-type": "document",
          "repository": "default",
          "uid": "3d3e1aae-5b1c-4314-b720-10b42e8d51d5",
          "path": "/default-domain/workspaces/pouetSpace/pouetFolder",
          "type": "Folder",
          "state": "project",
          "parentRef": "e4e625f9-55cb-4d8b-bb12-8e8d363447ce",
          "isCheckedOut": true,
          "isVersion": false,
          "isProxy": false,
          "changeToken": "3-0",
          "isTrashed": false,
          "title": "pouetFolder",
          "lastModified": "2019-09-11T07:54:01.837Z",
          "facets": [
            "Folderish",
            "NXTag"
          ],
          "schemas": [
            "common",
            "dublincore",
            "facetedTag"
          ]
        }
        

        Which is correct and expected.

      7. Nevertheless, the child is untrashed but its path is not renamed.
        The isTrashed flag is unset but the trashed path remains.
        Trying to access it through its trashed path still works:
        curl -sSL -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder/pouetFolderChild._1568188472362_.trashed | jq .
        {
          "entity-type": "document",
          "repository": "default",
          "uid": "3ef8262d-00fa-4958-9524-58248461470f",
          "path": "/default-domain/workspaces/pouetSpace/pouetFolder/pouetFolderChild._1568188472362_.trashed",
          "type": "Folder",
          "state": "project",
          "parentRef": "3d3e1aae-5b1c-4314-b720-10b42e8d51d5",
          "isCheckedOut": true,
          "isVersion": false,
          "isProxy": false,
          "changeToken": "3-0",
          "isTrashed": false,
          "title": "pouetFolderChild",
          "lastModified": "2019-09-11T07:54:17.323Z",
          "facets": [
            "Folderish",
            "NXTag"
          ],
          "schemas": [
            "common",
            "dublincore",
            "facetedTag"
          ]
        }
        

        Obviously the original path has not been restored:

        curl -sSL -u Administrator:Administrator https://nightly.nuxeo.com/nuxeo/api/v1/path/default-domain/workspaces/pouetSpace/pouetFolder/pouetFolderChild | jq .
        {
          "entity-type": "exception",
          "status": 404,
          "message": "/default-domain/workspaces/pouetSpace/pouetFolder/pouetFolderChild"
        }
        

        Expected behavior: the restored children documents should have their path updated like the parent.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 days, 3 hours, 30 minutes
                  3d 3h 30m