Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345034 - [client] Project deletion immediately after project creation fails
Summary: [client] Project deletion immediately after project creation fails
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: John Arthorne CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 16:38 EDT by John Arthorne CLA
Modified: 2011-09-01 11:43 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Arthorne CLA 2011-05-06 16:38:49 EDT
20110506

1) Create a new project (top level folder)
2) Try to delete the project

-> nothing happens

However the following works:

1) Create a new project
2) Hit F5
3) Delete the project
Comment 1 John Arthorne CLA 2011-05-06 16:45:31 EDT
The problem actually occurs during the creation in step 1). After the creation, fileCommands.js does this (line 435):

  dojo.hitch(explorer, function() {this.changedItem(this.treeRoot);}));

This calls explorer-table.js (line 40), which does this:

this.fileClient.fetchChildren(parent.ChildrenLocation).then(
  function(children) {
    eclipse.util.processNavigatorParent(parent, children);

What this does is:

- Get the children of the item to refresh
- Stick the new children into the parent object

However the other properties of the "parent" object are not refreshed. Deletion relies on a different property of the root element to do its work (the "Projects" element). I.e., we need to refresh the root, rather than the children of the root.

Susan, I spent ages looking at this but suspect I'm missing something obvious. How can I completely refresh the tree?
Comment 2 Susan McCourt CLA 2011-05-09 12:06:20 EDT
(In reply to comment #1)
> Deletion
> relies on a different property of the root element to do its work (the
> "Projects" element). I.e., we need to refresh the root, rather than the
> children of the root.
> 
> Susan, I spent ages looking at this but suspect I'm missing something obvious.
> How can I completely refresh the tree?

Since you want to completely replace the root element, I think you should use loadResourceList, supplying it the path.  That will get rid of the old cached tree root and refetch it.  However if we already have the new json object in hand after the create, we could reset this.treeRoot and then do the changedItem.

Let me know if you want me to take this.
Comment 3 John Arthorne CLA 2011-05-16 15:03:44 EDT
I have fixed this, but I had to add an optional "force" flag to loadResourceList. In this case the path has not changed so loadResourceList doesn't bother doing anything.

http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=1c2bdd1bb68faec337d977d567018962fdf971cc