Skip to content

posix: file revisions are not deleted when item is purged from trash #1855

Closed
opencloud-eu/reva
#419

Description

@butonic

create a new file and make three edits to it. The disk should now know them:

❯ tree -ah /home/jfd/.opencloud/storage/users/users/
[4.0K]  /home/jfd/.opencloud/storage/users/users/
└── [4.0K]  cd88bf9a-dd7f-11ef-a609-7f78deb2345f
    ├── [   3]  New file.txt
    ├── [4.0K]  .oc-nodes
    │   ├── [4.0K]  b3
    │   │   └── [4.0K]  f7
    │   │       └── [4.0K]  3c
    │   │           └── [4.0K]  e2
    │   │               ├── [   0]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:50.976406172Z
    │   │               ├── [   1]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:55.53780399Z
    │   │               └── [   2]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:56.603235102Z
    │   └── [4.0K]  locks
    └── [4.0K]  .oc-tmp

9 directories, 4 files

when you delete the file it is moved to the trash and the disk will look like this:

❯ tree -ah /home/jfd/.opencloud/storage/users/users/
[4.0K]  /home/jfd/.opencloud/storage/users/users/
└── [4.0K]  cd88bf9a-dd7f-11ef-a609-7f78deb2345f
    ├── [4.0K]  .oc-nodes
    │   ├── [4.0K]  b3
    │   │   └── [4.0K]  f7
    │   │       └── [4.0K]  3c
    │   │           └── [4.0K]  e2
    │   │               ├── [   0]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:50.976406172Z
    │   │               ├── [   1]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:55.53780399Z
    │   │               └── [   2]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:56.603235102Z
    │   └── [4.0K]  locks
    ├── [4.0K]  .oc-tmp
    └── [4.0K]  .Trash
        ├── [4.0K]  files
        │   └── [   3]  b3f73ce2-8d57-4a81-8827-031db9b962ac.trashitem
        └── [4.0K]  info
            └── [  63]  b3f73ce2-8d57-4a81-8827-031db9b962ac.trashinfo

12 directories, 5 files

now if you purge the item from trash the node metadata for revisions should have been deleted. however, we can see that they are still there:

❯ tree -ah /home/jfd/.opencloud/storage/users/users/
[4.0K]  /home/jfd/.opencloud/storage/users/users/
└── [4.0K]  cd88bf9a-dd7f-11ef-a609-7f78deb2345f
    ├── [4.0K]  .oc-nodes
    │   ├── [4.0K]  b3
    │   │   └── [4.0K]  f7
    │   │       └── [4.0K]  3c
    │   │           └── [4.0K]  e2
    │   │               ├── [   0]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:50.976406172Z
    │   │               ├── [   1]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:55.53780399Z
    │   │               └── [   2]  -8d57-4a81-8827-031db9b962ac.REV.2025-11-13T13:05:56.603235102Z
    │   └── [4.0K]  locks
    ├── [4.0K]  .oc-tmp
    └── [4.0K]  .Trash
        ├── [4.0K]  files
        └── [4.0K]  info

12 directories, 3 files

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions