Bug 361006 - new file and new folder operations could use progress indicator
Summary: new file and new folder operations could use progress indicator
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 1.0 RC1   Edit
Assignee: Susan McCourt CLA
QA Contact:
URL:
Whiteboard:
Keywords: usability
: 388826 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-10-14 12:45 EDT by Susan McCourt CLA
Modified: 2012-10-01 12:56 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan McCourt CLA 2011-10-14 12:45:00 EDT
0.3 RC2
at times it can take over 3 seconds for the UI to update on a new file/new folder operation.  We should use the progress service so the user sees something is happening.
Comment 1 Susan McCourt CLA 2011-10-14 12:58:24 EDT
investigate for rc3
Comment 2 John Arthorne CLA 2011-10-14 13:37:46 EDT
Strange that it takes so long. The network communication for me is only 200-300ms (using orion.eclipse.org from home). But I agree in general any file operation could potentially take a long time so a message giving feedback that it's running would be helpful (I wouldn't actually expect it to report meaningful progress).
Comment 3 Susan McCourt CLA 2011-10-14 14:15:29 EDT
(In reply to comment #2)
> Strange that it takes so long. The network communication for me is only
> 200-300ms (using orion.eclipse.org from home). But I agree in general any file
> operation could potentially take a long time so a message giving feedback that
> it's running would be helpful (I wouldn't actually expect it to report
> meaningful progress).

I was also using orion.eclipse.org from home.  Not sure what your home connection is like, mine is 1.5Mbps (believe it or not this is the fastest speed currently available on DSL where I live)

I was having some timeouts (possible hiccups) earlier today when I saw this.  Just retried, and while the navigator seems more responsive, it's still about 2 seconds from hitting enter on a file name to updating the UI.  About the same for deletes as well.
Comment 4 Susan McCourt CLA 2011-10-18 15:02:31 EDT
proposed fix is in remote branch origin/bug361006

I added progress handling for new file, new folder, new project, delete, and link project.  

I think it helps a lot, on my home network I can have 2-3 second lags and often wonder if anything is happening.

The downside to this patch is that if there is an error, the progress message could be left dangling in the progress area.  See bug 361293.

Since the easiest thing to get an error with is link, maybe we shouldn't implement progress handling for link until we can get the errors reported correctly.
Comment 5 Susan McCourt CLA 2011-10-18 15:04:28 EDT
John, could you review the code in remote branch origin/bug361006?
Simon, adding you for approving that we should fix this.  If indeed we are swallowing service errors (bug 361293) we may want to remove the progress handling for link, since it's not enabled on orionhub, orion.eclipse.org, and therefore you'll always get an error and "stuck" progress message.
Comment 6 John Arthorne CLA 2011-10-18 16:21:31 EDT
So with this change, error reporting for file/folder creation/deletion is broken, whereas before this was displaying fine. For example, trying create a file/folder that already exists, or contain an invalid character. In master this correctly shows an error message in the status area, but with your branch you just get hanging progress forever.

The progress reporting does look very nice. But, considering that is a cosmetic improvement, vs losing error messages which are important function, I don't like that trade-off.
Comment 7 Simon Kaegi CLA 2011-10-18 21:58:06 EDT
Yep, similar feeling to John. Rather have the broken I know than the broken I don't. I'll try to look at bug 361293 tomorrow to see if there is a root problem blocking this.
Comment 8 Susan McCourt CLA 2011-10-19 11:31:52 EDT
> So with this change, error reporting for file/folder creation/deletion is
> broken, whereas before this was displaying fine. For example, trying create a
> file/folder that already exists, or contain an invalid character. In master
> this correctly shows an error message in the status area, but with your branch
> you just get hanging progress forever.
> 
> The progress reporting does look very nice. But, considering that is a cosmetic
> improvement, vs losing error messages which are important function, I don't
> like that trade-off.

oh, my, this is why we do reviews!  I would never have proposed this change if I realized that it caused errors to be swallowed that were being reported before.  I was using "Link Folder" as my test case for error reporting, which is behaving differently (why?)  

In the current build, the link errors are reported with that funny dialog.  With the change, you get the funny dialog (and the hanging progress message) but you still get the error.  I did not realize that (some types of) errors were completely being swallowed by progress service after this change.

I'll leave the milestone set for now, in case we decide the blocking bug is actually worth fixing, but I'm assuming for now that this will come in later.
Comment 9 Susan McCourt CLA 2011-10-19 15:20:40 EDT
Ok, I understand now.
Bug 361293 and the "Link Folder" scenario was a special case/red herring involving the auth plugin.

The swallowing of the error case for "new folder" and others appears to be a misunderstanding on my part about error handling when the progress manager is in charge.  I thought the progress handler would dispatch errors, but it does not. 

I changed patterns like this:
fileClient.createFolder(item.Location, name).then(
  dojo.hitch(explorer, function() {this.changedItem(item);}),
  function(error) {
    serviceRegistry.getService("orion.page.message").then(
      function(statusService) {
        statusService.setErrorMessage(error);
      });
  });

to:
serviceRegistry.getService("orion.page.message").then(
  function(progressService) {
    var deferred = fileClient.createFolder(item.Location, name);
    progressService.showWhile(deferred, "Creating folder " + name + "...").then(
      dojo.hitch(explorer, function() {this.changedItem(item);}));
  });

Instead, we would need to do something like:
serviceRegistry.getService("orion.page.message").then(
  function(progressService) {
    var deferred = fileClient.createFolder(item.Location, name);
    progressService.showWhile(deferred, "Creating folder " + name + "...").then(
      dojo.hitch(explorer, function() {this.changedItem(item);}),
      function(error) {
        serviceRegistry.getService("orion.page.message").then(
        function(statusService) {
          statusService.setErrorMessage(error);
        });
    );
  });

That last expression seems unnecessarily complicated and error-prone.  Instead, we could ensure the progress handler provides an errback that does the right thing, since it is the error reporter anyway.  I changed the progress handler to do this, and the correct thing happens for new file and folder.  I pushed it to the remote branch origin/bug361006, just to save the thought.

However I'm not sure this is the correct solution, and we need to look at how other progress operations are doing this (such as in git).

So I'm assigning this bug to 0.4 and will talk to John about what we think the progress handler should be doing.
Comment 10 Susan McCourt CLA 2011-11-24 11:33:58 EST
move and copy need progress handlers also.  There is a long enough pause that one wonders if it's working
Comment 11 Susan McCourt CLA 2011-12-08 14:11:20 EST
would also be good to have one for "reload plugins"
Comment 12 Szymon Brandys CLA 2012-04-20 07:45:03 EDT
Maybe we should have setProgressResult/Message(display, delay)? Then the body of each command could be like:

setProgressMessage("Creating file", 3000);
... some logic
setProgressResult("");
Comment 13 Susan McCourt CLA 2012-05-18 15:29:47 EDT
moving out of 0.5M2 to 0.5 milestone until we have more specific buckets for future
Comment 14 Susan McCourt CLA 2012-09-05 11:51:54 EDT
*** Bug 388826 has been marked as a duplicate of this bug. ***
Comment 15 Susan McCourt CLA 2012-09-05 11:52:20 EDT
check all folder operations, such as delete...
Comment 16 Susan McCourt CLA 2012-09-19 16:18:25 EDT
I added progress handlers to new file and new folder while working on the "create new content" support in bug 378749.

However I want to keep this bug open in RC1 for general testing of navigator file operations, both for progress, and to make sure no error handlers have been swallowed.
Comment 17 Susan McCourt CLA 2012-10-01 12:56:19 EDT
Fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=db066a7718c0d9412ed56bb42bef2e73d8f709ac.

Added progress handlers to rename, delete, link project, move/copy.  With the recent server slowdowns, I thought it best to provide progress on all the file operations.  Tested that progress is reported correctly.  

Tested error reporting for new file, folder, project, link, import, move, copy.