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

Bug 507690

Summary: Trying to create a project with the same name as an existing one yields strange error
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Remy Suen <remy.suen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: 13.0   
Target Milestone: 13.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/85331
https://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=a8428a7c4d92a4e7888a238f1344bc4e43e61fce
Whiteboard:

Description Michael Rennie CLA 2016-11-17 11:26:14 EST
on orion.eclipse.org / orionhub.org if you try to create a basic project that has the same name as one already in the workspace, you get a weird green banner showing up with the text "[object Object]". 

I would expect it to be red, and to tell me what the problem was.

Even better would be to warn me when I enter the name of my new project, rather than an "after the failure" error.
Comment 1 Casey Flynn CLA 2016-11-17 17:38:26 EST
(In reply to Michael Rennie from comment #0)
> on orion.eclipse.org / orionhub.org if you try to create a basic project
> that has the same name as one already in the workspace, you get a weird
> green banner showing up with the text "[object Object]". 
> 
> I would expect it to be red, and to tell me what the problem was.
> 
> Even better would be to warn me when I enter the name of my new project,
> rather than an "after the failure" error.

After testing this on a clean client running on OrionHub, it displays an error in red "Duplicate project name: test"

Do you have another way of recreating this issue?
Comment 2 Remy Suen CLA 2016-11-18 08:19:05 EST
(In reply to Casey Flynn from comment #1)
> After testing this on a clean client running on OrionHub, it displays an
> error in red "Duplicate project name: test"
> 
> Do you have another way of recreating this issue?

I get the same behaviour as Casey.
Comment 3 Michael Rennie CLA 2016-11-18 12:40:27 EST
(In reply to Casey Flynn from comment #1)
> (In reply to Michael Rennie from comment #0)
> > on orion.eclipse.org / orionhub.org if you try to create a basic project
> > that has the same name as one already in the workspace, you get a weird
> > green banner showing up with the text "[object Object]". 
> > 
> > I would expect it to be red, and to tell me what the problem was.
> > 
> > Even better would be to warn me when I enter the name of my new project,
> > rather than an "after the failure" error.
> 
> After testing this on a clean client running on OrionHub, it displays an
> error in red "Duplicate project name: test"
> 
> Do you have another way of recreating this issue?

Apparently, I do not. Today, rather than the green "[object Object]" banner I now get (on orion.eclipse.org): 

"EEXIST: file already exists, mkdir '/localdata/orion.eclipse.org/serverworkspace/mr/mrennie/OrionContent/bower'" in red.

This is likely due to the fix for bug 507199

State problems aside, that is not a very good message for end users. It would be nice / more friendly if it specifically says what is wrong. In this case I would expect to see "Duplicate project name: bower".
Comment 4 Remy Suen CLA 2016-11-18 16:46:44 EST
(In reply to Michael Rennie from comment #3)
> "EEXIST: file already exists, mkdir
> '/localdata/orion.eclipse.org/serverworkspace/mr/mrennie/OrionContent/
> bower'" in red.
> 
> This is likely due to the fix for bug 507199
> 
> State problems aside, that is not a very good message for end users. It
> would be nice / more friendly if it specifically says what is wrong. In this
> case I would expect to see "Duplicate project name: bower".

I was able to reproduce the problem.

Casey, I can take this if you want.
Comment 5 Casey Flynn CLA 2016-11-18 17:14:35 EST
TYSM!
Comment 6 Remy Suen CLA 2016-11-18 21:59:23 EST
The Java server checks for this case in WorkspaceResourceHandler's validateProjectName(*) method and provides an appropriate error message.

On Node, we are simply wrapping the raw error from mkdir and sending it back to the client. I will change the code to instead wrap the error into a custom message if the error is an EEXIST.
Comment 7 Eclipse Genie CLA 2016-11-18 22:20:57 EST
New Gerrit change created: https://git.eclipse.org/r/85331
Comment 9 Michael Rennie CLA 2016-11-21 10:20:47 EST
Thanks Remy!