Skip to content
This repository was archived by the owner on Nov 23, 2026. It is now read-only.
This repository was archived by the owner on Nov 23, 2026. It is now read-only.

restoring a file from "Deleted files" (trashbin) is not possible if the original folder does not exist any-more #1753

Closed

Description

@individual-it

Steps to reproduce

  1. create a file in a folder
  2. delete the file
  3. rename the folder
  4. try to restore the file

Expected behaviour

file should be restored

Actual behaviour

file is not restored. Error: Restoration of file failed The destination node is not found
The user has no idea from where the file came from. see #1525
So its very hard to restore the file

Activity

  1. added
    Type:Bug
    on Aug 9, 2019
  2. added
    Priority:p2-high
    on Aug 16, 2019
  3. added this to the backlog milestone on Aug 23, 2019
  4. modified the milestones: backlog, on Sep 24, 2019
  5. PVince81 commented on Sep 27, 2019

    @PVince81
    Contributor

    I'd expect the trashbin API to know where the original location is as it's stored in the database.

    The behavior in OC 10 was that if the target folder does not exist, we fall back to putting the restored item into the user's home root.

  6. PVince81 commented on Oct 14, 2019

    @PVince81
    Contributor

    Maybe in Phoenix we can detect this situation, this is likely a 409 if the folder does not exist, so after that fall back to a MOVE to the root

  7. PVince81 commented on Oct 14, 2019

    @PVince81
    Contributor

    in case we rely on the error code, need to make sure it's not happening also if the target destination file already exists like in #1730

  8. individual-it commented on Nov 25, 2019

    @individual-it
    MemberAuthor

    assigned @jasson99 and put into sprint for creating tests

  9. haribhandari07 commented on Dec 9, 2019

    @haribhandari07
    Contributor

    @individual-it since tests have been added should we mark this issue as done and remove from current sprint?

  10. 5 remaining items

  11. tbsbdr commented on Mar 15, 2022

    @tbsbdr

    Proposal

    @kulmann we also need to think of restoring files in spaces - imo the usecase "original path vanished" could be not soooo cornerish in Spaces any more, as more hands will touch folders in Spaces.

    I would still opt for option a) -> restore to user personal home.

    • In addition: If the file was deleted from a Space, it should be restored to the Space root.
    • Proposal: Since you are no longer alone in a Spaces, there is a risk that Spaces will become "messy", just like any good shared apartment kitchen. Therefore we could store restored files in a ..Spaces/Marketing/Restored-from-trashbin folder. Advantage:
      1. Communication: Folder title communicates to other, not involved Space members where those files came from. Prevents confusion.
      2. Tidy up: Space root is less unlikely to get messy

    Also if I think of the user manual, I think its a bit more easy to comprehend written doc like: "If path changed: find all restored files in Restored-from-trashbin in personal/Sapcexy" rather than "find restored files in the root of personal/Spacexy"

    @kulmann what do you think, also regarding Spaces?


    Note - behaviour on Windows is:

    • Files get always restored to the path, where they where originally deleted from (even if the original path is deleted or renamed). That means, that a "restore" on windows could re-create the complete, original path even if it didn't exist any more.
  12. lookacat commented on Apr 4, 2022

    @lookacat
    Contributor

    Would also prefer the windows method. @kulmann should I have a look if thats possible?

  13. kulmann commented on Apr 4, 2022

    @kulmann
    Contributor

    Would also prefer the windows method. @kulmann should I have a look if thats possible?

    Not yet. I'd like to hear @pmaier1's opinion on this first.

    From a technical perspective we can only restore rebuilding the original path, because we don't have any parent folder file id via the API. The question at this time is if we want the windows behaviour (then you could implement it) or if we don't want it (then this ticket needs to remain on hold).

  14. pmaier1 commented on Apr 4, 2022

    @pmaier1

    Not yet. I'd like to hear @pmaier1's opinion on this first.

    Intuitively I also prefer Windows behavior. Dropbox also follows this pattern. They even restore related parent folders in bulk (if those are still in the trash bin).

    Interestingly, Box went the location picker way
    Screenshot from 2022-04-04 16-11-55

    That certainly gives the user more control but is maybe more complex. If everyone agrees, I'd go for the simple Windows-based behavior and keep the location picker in mind as a potential improvement for later.

    I think this works better than (arbitrarily) restoring to root. What do you think?

  15. kulmann commented on Apr 4, 2022

    @kulmann
    Contributor

    If everyone agrees, I'd go for the simple Windows-based behavior and keep the location picker in mind as a potential improvement for later.

    Fine by me. Let's do it this way 👍

  16. individual-it commented on Apr 5, 2022

    @individual-it
    MemberAuthor

    Just think of the corner case that you might not have the permissions anymore to recreate the original path

    Alice creates "simple-folder/subfolder/lorem.txt"
    Alice shares "simple-folder" with "Brian" as editor
    Brian accepts share
    Brian deletes Shares/simple-folder/subfolder/lorem.txt
    Alice changes the permissions on the share to Brian to read-only
    Brian restores lorem.txt from the trashbin

    Or there might be the case that the share is gone all-together, or its even a totally different Share from an other user with the same name

  17. self-assigned this
    on May 9, 2022
  18. lookacat commented on May 11, 2022

    @lookacat
    Contributor

    args, restoring the folder structure isn't a problem but one case is really difficult.

    1. If you have a file in a subfolder and you delete this file first and then the parent folder
    2. Restore this file (Folder structure gets recreated)
    3. Restore the deleted folder (All files are restored but the file restored previously because the folder get overwritten)
      I'm not sure if we have the possibility to do this via the client.
  19. JammingBen commented on May 11, 2022

    @JammingBen
    Contributor

    Hmm, I think it requires a product decision first. What should happen when you restore a folder with a name that already exists in your personal files?

    a) Overwrite the folder
    b) Restore the folder as "new resource" e.g. by appending a suffix like "Folder (1)".

    Currently we do a), which is No-Go IMO as folders can get overwritten easily. The overwritten folder then get's moved to the trash bin.

  20. lookacat commented on May 11, 2022

    @lookacat
    Contributor

    Thx for the input, I would go for the suffix, i think that is how windows handles it as well

  21. JammingBen commented on May 11, 2022

    @JammingBen
    Contributor

    I also prefer this option, oC10 does it like this as well. But I'm not sure how easy it is to implement. Worst case scenario would be that we also need adjustments in backend and/or SDK.

    @tbsbdr @pmaier1 see #1753 (comment) -> do you agree with b) as the preferred solution?

  22. kulmann commented on Jun 14, 2022

    @kulmann
    Contributor

    Since we now have the resolve conflict dialog where the user gets prompted to choose one out of skip, overwrite and keep both we could use exactly the same pattern here as well. What do you think @lookacat @JammingBen ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Estimation:M(3)Priority:p2-highType:Bugfeature:files

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions