[NetworkBrowser] AutoMount.mountTimer() can test on wrong Console
AutoMount.mountTimer()
tries to guess which console called it to call the callback in self.callback
.
Unless NetworkBrowser
is opened, but no actions performed in it (which calls NetworkBrowser.cleanup()
and hence iAutoMount.stopMountConsole()
), immediately before Mountpoints management (MountView
) is opened and a mount deleted, then in AutoMount.mountTimer()
both self.MountConsole
and self.removeConsole
will be non-null, which will result in the test being made on self.MountConsole.appContainers
rather than on self.removeConsole.appContainers
.
Using a shared variable, self.callback
, to contain the callback for both MountConsole
and removeconsole
is also potentially problematic, since the iAutoMount
instance is persistent.
Calling AutoMount.timer.startLongTimer(1)
to call AutoMount.mountTimer()
from the main dispatch loop is an unnecessary delay. A 1ms (or even no delay) using eTimer.start()
is enough for the purpose.
Replication
Replication is only possible by adding debug prints. Add code to print the values of self.MountConsole
and self.removeConsole
on entering AutoMount.mountTimer()
.
Then run a test on the modified code. Run a network browser scan in MENU>Setup>Network>Network browser if there are no scanned servers.
Enter the network browser if necessary and set up two network mounts of any type that can be deleted during the test, then exit the browser.
Enter MENU>Setup>Network>Mount manager>Mountpoints management and delete one of the newly created mounts. When that completes, check the log for the most recent print of self.MountConsole
and self.removeConsole
in the log. It should show both of them as not None
, which means that for the test in AutoMount.mountTimer()
, self.MountConsole.appContainers
rather than the correct test on self.removeConsole.appContainers
.
Exit the mount manager, and enter MENU>Setup>Network>Network browser, then EXIT immediately.
Then re-enter MENU>Setup>Network>Mount manager>Mountpoints management and delete the other of the newly created mounts. On completion, check the log as before: self.MountConsole
will be None
self.removeConsole
will be not None
, which means that the test in AutoMount.mountTimer()
will be on the correct console for the operation.