Bug #15685
closedFile rename doesn't work, succeeds when no name is provided
Description
Renaming a file in a collection with a blank value reports a successful rename to the user even though file doesn't get renamed.
Related issues
Updated by Peter Amstutz over 4 years ago
- Subject changed from File rename succeeds when no name is provided to File rename doesn't work, succeeds when no name is provided
Updated by Peter Amstutz about 4 years ago
- Target version set to 2020-10-21 Sprint
- Assigned To set to Daniel Kutyła
Updated by Peter Amstutz almost 4 years ago
- Target version changed from 2020-10-21 Sprint to 2020-11-04 Sprint
Updated by Peter Amstutz almost 4 years ago
- Assigned To changed from Daniel Kutyła to Lucas Di Pentima
Updated by Lucas Di Pentima almost 4 years ago
- Status changed from New to In Progress
Updated by Lucas Di Pentima almost 4 years ago
Updates at arvados-workbench2|3af60f74 - branch 15685-file-renaming-empty-name
Test run: developer-tests-workbench2: #136
- File renaming was fixed in #16592.
- Fixes webdav service's backend error response handling.
- Adds integration tests for file renaming cases.
Updated by Lucas Di Pentima almost 4 years ago
- Related to Bug #16592: File renaming doesn't work added
Updated by Lucas Di Pentima almost 4 years ago
- Target version changed from 2020-11-04 Sprint to 2020-11-18
Updated by Peter Amstutz almost 4 years ago
15685-file-renaming-empty-name @ commit:arvados-workflow2|3af60f74e1bb43c779d660bda187d780b677188e
I found a couple of edge cases:
- I can enter a name of "&" which gets turned into "&"
- I can enter a name of " "
After renaming a file from a valid name either of the invalid names, I can't rename or delete the file:
Rename gets "Could not rename the file: Forbidden"
Delete gets "Could not remove file."
It needs to correctly handle or prevent these edge cases.
Updated by Peter Amstutz almost 4 years ago
A couple other illegal names to check for are "." and ".."
Updated by Lucas Di Pentima almost 4 years ago
Updates at arvados-workbench2|6528692d
Test run: developer-tests-workbench2: #168
- A file named '&' was displayed as '&' because that's how it receives the data from keep-web, so I added a html decoding call.
- When trying to rename the '&' the MOVE request were directed to '&' instead.
- A file name can legally be ' ' (whitespace) as per the Ruby SDK (see
sdk/ruby/test/test_keep_manifest.rb
starting at L307. - Expanded file renaming integeration tests.
An interesting side effect of using webdav to rename files is that we can rename a file to something like 'subdir/a_file' and it'll be moved to the 'subdir/' directory. I haven't written test cases for this yet, just in case it isn't a desirable behavior, and if that's the case, we should add validations on the rename form to avoid having '/' chars on the names (right now the validations are done on the backend, and I think that's a good thing, to avoid having duplicated code).
Updated by Peter Amstutz almost 4 years ago
From chat:
- WB2 rename should allow editing the entire file path within the collection. This enables the user to move files into other directories of the collection.
- WB2 should not accept names with leading or trailing spaces (even though they are technically allowable on the backend).
- This should probably include a validation that splits on '/' and makes sure the path parts don't have leading or trailing spaces either.
Updated by Lucas Di Pentima almost 4 years ago
Updates at arvados-workbench2|1b9616cd
Test run: developer-tests-workbench2: #174
- WB2 now shows the entire file path on the "rename file" dialog.
- Added validations so that every path part cannot have leading/trailing whitespaces or be an empty string.
- Added more integration tests checking these new behaviors.
Updated by Lucas Di Pentima almost 4 years ago
Test re-run: developer-tests-workbench2: #175
Updated by Peter Amstutz almost 4 years ago
15685-file-renaming-empty-name @ arvados-workbench2|1b9616cd4d120cdc473e457637287502fff531b8
Renaming works much better now, thank you! I can even rename invalid files with invalid names getting an error or strange behavior. Moving files into and out of subdirectories seems to work fine.
Moving files be
I found two user interaction bugs.
- If I open "Rename" and then enter an invalid name, I don't see an error until the text box loses focus. The "Ok" button remains disabled, but I have no feedback about what is wrong with the name until I try to click outside the text box (hitting enter doesn't do it). After the error appears once, then it appears/disappears immediately based on whether the contents of the text box is valid like I would expect to happen.
- The invalid file names "." and ".." are not flagged as errors, it allows you to hit "Ok" but then you get the non-specific error "Could not rename the file: Precondition Failed". Related, I can also include "." and ".." when renaming files, which seems to be interpreted as Unix path, which suggests you might be able to enter a filename like "../../c=collection_uuid/newfile" and it would move the file to another collection (if keep-web supports that.)
Updated by Lucas Di Pentima almost 4 years ago
Updates at arvados-workbench2|4745e251
Test run: developer-tests-workbench2: #176
- Fixed both issues. The "validation on blur" was just a
redux-form
config setting. - Ajusted integration tests a bit.
Updated by Peter Amstutz almost 4 years ago
Lucas Di Pentima wrote:
Updates at arvados-workbench2|4745e251
Test run: developer-tests-workbench2: #176
- Fixed both issues. The "validation on blur" was just a
redux-form
config setting.- Ajusted integration tests a bit.
Thanks, this LGTM!
Updated by Anonymous almost 4 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados-workbench2|a0d117b3fae1311a6eb98612946be8966bdf2cf5.