Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 429916

Summary: rename is broken (again)
Product: [ECD] Orion Reporter: Boris Kozorovitzky <majorzbzzn>
Component: NodeAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: elijahe, ken_walker, mamacdon
Version: 5.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Boris Kozorovitzky CLA 2014-03-07 16:09:14 EST
Create a file within a directory.
Right-click the file from the outliner in the editor.
Select Rename

Expected: Rename box to appear on the file
Actual: Rename box appears randomly on other nodes

note that pressing F2 works, only the mouse click doesn't
Comment 1 Ken Walker CLA 2014-03-07 16:32:35 EST
Indeed, when I tried to use the context menu to rename a file it offered to rename the parent folder
Comment 2 Elijah El-Haddad CLA 2014-03-07 16:51:05 EST
So far I haven't been able to reproduce this on orion.eclipse.org using either Chrome, Firefox or IE. I tried renaming files and folders with the context menu and the dropdown menus and it always worked.

Can you please tell me which browser you were using and any more specific information about the steps to reproduce this issue?
Comment 3 Boris Kozorovitzky CLA 2014-03-07 17:07:18 EST
I am using the node version (latest on NPM)
With Chrome (latest)

I can attach an animated gif if needed but since Ken is able to reproduce it too I think it would be best to talk directly with him.
Comment 4 Mark Macdonald CLA 2014-03-07 17:49:58 EST
The problem only happens the Node server. The Node backend is ultimately at fault, but there's problems in the UI as well. I have a fix.
Comment 5 Mark Macdonald CLA 2014-03-07 17:52:17 EST
There was a chain of cascading exceptions here that ends with Rename being broken. (You can see the original exception by opening the JS console while browsing directories on an Orion Node server).

i) The Node server sometimes returns a bogus file object like this for regular files:
>  "Directory": false,
>  "ChildrenLocation": null  // wrong: this property should not be here at all

ii) In the UI, extensionCommands does not check for null fields, so it throws when the "Open Related > Shell" command tries to perform a string replacement on the null ChildrenLocation.

iii) commandRegistry._render() does not perform any exception handling, so the exception thrown by extensionCommands terminates rendering prematurely.

I didn't debug fully, but this somehow causes the Rename command to target the wrong item -- maybe because _render() blows up before it can create a CommandInvocation targeting the file you actually selected.

I fixed these in here
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=bd943f4
Comment 6 Elijah El-Haddad CLA 2014-03-07 17:53:43 EST
Thanks Mark. Please feel free to re-assign this defect to yourself (since I can't do that yet).
Comment 7 Mark Macdonald CLA 2014-03-07 17:58:08 EST
(In reply to Elijah El-Haddad from comment #6)
> Thanks Mark. Please feel free to re-assign this defect to yourself (since I
> can't do that yet).

Someone needs to start the committer elections already.
Comment 8 Mark Macdonald CLA 2014-03-07 18:58:15 EST
I published v0.0.27 of orion to npm, which includes this fix (and is a smaller download as well, since I removed some files that shouldn't have been published).

https://npmjs.org/package/orion