Bug 231964 - [ssh] SSH login dialog appears twice after cancel, when doing Refresh on a node
Summary: [ssh] SSH login dialog appears twice after cancel, when doing Refresh on a node
Status: RESOLVED FIXED
Alias: None
Product: Target Management
Classification: Tools
Component: RSE (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.0 RC1   Edit
Assignee: David McKnight CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
: 160810 (view as bug list)
Depends on: 149285
Blocks:
  Show dependency tree
 
Reported: 2008-05-13 18:36 EDT by Martin Oberhuber CLA
Modified: 2008-09-16 16:40 EDT (History)
2 users (show)

See Also:


Attachments
patch to catch operationcancelledexception when connecting (1.30 KB, patch)
2008-05-14 10:44 EDT, David McKnight CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Oberhuber CLA 2008-05-13 18:36:43 EDT
+++ This bug was initially created as a clone of Bug #149285 +++

From bug 149285 comment 11:

When I expand the My Home Filter and press cancel in SSH, I get an "Empty
List" subnode. When I select "My Home" again and press Refresh, I get the login
dialog; if I cancel, I get the login dialog again.

Login dialog should appear once only.
Comment 1 Martin Oberhuber CLA 2008-05-13 18:38:05 EDT
Here is a stack trace:

SubSystem.checkIsConnected()
   -> throws SystemMessageException
RemoteFileSubSystem.getTargetForFilter(ISystemFilterReference)
   -> eats the exception silently, but returns null
SystemView$ResourceChangedJob.runInUIThread(IProgressMonitor) line 2207
   -> doesnt know that it was canceled and tries to continue


DaveM, I think that's a problem which only you can finish... thanks
Looks like second time we pop into connect from here:

AbstractSystemViewAdapter.fetchDeferredChildren()
DeferredTreeContentManager$1.run(IProgressMonitor)

Comment 2 David McKnight CLA 2008-05-14 10:44:05 EDT
Created attachment 100189 [details]
patch to catch operationcancelledexception when connecting

Martin, I don't see the same thing as you in this scenario.  What I found was that when we prompted for password and the user cancelled, we were throwing an OperationCancelledException.  We were not catching that and setting the isCancelled flag to true.  That meant that when we get to the following code, the prompter.isCancelled() returned false instead of true, allowing the connect to continue to the service layer. 

			if (prompter.isCancelled()) {
				SystemMessage cancelledMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED);
				SystemMessageObject cancelledMessageObject = new SystemMessageObject(cancelledMessage, ISystemMessageObject.MSGTYPE_CANCEL, _remoteObject);
				_collector.add(cancelledMessageObject, monitor);
				throw new InterruptedException();
			}
			try
			{
				ss.getConnectorService().connect(monitor);

Is my case different from yours?
Comment 3 David McKnight CLA 2008-05-14 16:53:18 EDT
I committed the patch to cvs.
Comment 4 Martin Oberhuber CLA 2008-09-16 16:40:15 EDT
*** Bug 160810 has been marked as a duplicate of this bug. ***