Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[s3] Skip move/copy operation if parent path of source is equal to de…
…stination path (#3478) What changes were proposed in this pull request? - Whenever someone attempt to copy multiple files on Hue File Browser, they can encounter dataloss if they do not wait for the model pop-up to fully load. RCA - Found the root cause and it's because of a bad call to Hue server which is sending wrong destination path. - When the modal pops up to select the destination path, it tries to list down the content of the directory chosen and that takes some extra seconds but the button to move is clickable still. When someone clicks the 'Move' button but the path has not loaded correctly, it sends the wrong path (either the source path or default user home path) instead of actual destination path with the request. - This messes up the move operation in the backend where it actually doesn't move stuff to the destination because the path was incorrect or the keys were already present in the wrong path so it skips them, and afterwards cleanup the keys from the source path. Fix - Adding guardrail checks to skip the operation when the parent path of source is equal to destination for copy and move operations. How was this patch tested? - Tested manually.
- Loading branch information