Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Rename Request Is Not Correctly Validated #1555

Closed
mwu-tow opened this issue Mar 8, 2021 · 0 comments · Fixed by #1570
Closed

Project Rename Request Is Not Correctly Validated #1555

mwu-tow opened this issue Mar 8, 2021 · 0 comments · Fixed by #1570
Assignees
Labels
d-intermediate Difficulty: some prior knowledge required p-high Should be completed in the next sprint

Comments

@mwu-tow
Copy link
Contributor

mwu-tow commented Mar 8, 2021

General Summary

Calling project/rename with a name that is not a valid referent name succeeds. This tricks IDE into thinking that the project was actually renamed into whatever the user typed, while the underlying name is different. This leads to further issues, like visualizations not working after rename.

Steps to Reproduce

Open any project in IDE, rename to a invalid identifier, like FooBarr.

See the websocket log.

{"jsonrpc":"2.0","id":0,"method":"project/list","params":{"numberOfProjects":null}} | 83 | 11:39:02.756
{"jsonrpc":"2.0","id":0,"result":{"projects":[{"name":"Unnamed","id":"4f7582e9-d02a-4602-824f-cdaa8aaf2395","engineVersion":"0.2.6","lastOpened":"2021-03-08T10:37:29.8014162Z"},{"name":"Import_Test","id":"1c01cbea-6837-4e5d-a8b1-ab305478b7b1","engineVersion":"0.2.6","lastOpened":"2021-03-08T09:47:23.603224Z"},{"name":"Trams_Project","id":"cc690e57-277e-4793-9086-e25693625412","engineVersion":"0.2.1","lastOpened":null}]}} | 424 | 11:39:02.775
{"jsonrpc":"2.0","id":1,"method":"project/open","params":{"missingComponentAction":"Install","projectId":"4f7582e9-d02a-4602-824f-cdaa8aaf2395"}} | 145 | 11:39:02.864
{"jsonrpc":"2.0","id":1,"result":{"engineVersion":"0.2.6","languageServerJsonAddress":{"host":"127.0.0.1","port":52272},"languageServerBinaryAddress":{"host":"127.0.0.1","port":65131}}} | 185 | 11:39:06.156
{"jsonrpc":"2.0","id":2,"method":"project/rename","params":{"name":"FooBarr","projectId":"4f7582e9-d02a-4602-824f-cdaa8aaf2395"}} | 129 | 11:41:14.164
{"jsonrpc":"2.0","id":2,"result":null}

Expected Result

Call should fail with ProjectNameValidationError.

Actual Result

Call succeeds, renaming project to Foo_Barr — which is not what was requested.

Enso Version

For example:

    Enso Project Manager
    Version:    0.2.6
    Built with: scala-2.13.5 for GraalVM 21.0.0.2
    Built from: enso-0.2.6 @ aec61292c467c3c52e2259ac9e8cd03670c77f15
    Built on:   Windows 10 (amd64)
@iamrecursion iamrecursion assigned iamrecursion and 4e6 and unassigned iamrecursion Mar 8, 2021
@iamrecursion iamrecursion added p-high Should be completed in the next sprint d-intermediate Difficulty: some prior knowledge required labels Mar 8, 2021
@4e6 4e6 closed this as completed in #1570 Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d-intermediate Difficulty: some prior knowledge required p-high Should be completed in the next sprint
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants