[tbb-bugs] #23240 [Applications/Tor Launcher]: do not show progress bar at zero when bootstrap progress is greater than zero

Tor Bug Tracker & Wiki blackhole at torproject.org
Tue Aug 15 02:04:09 UTC 2017


#23240: do not show progress bar at zero when bootstrap progress is greater than
zero
---------------------------------------+------------------------------
 Reporter:  mcs                        |          Owner:  brade
     Type:  defect                     |         Status:  needs_review
 Priority:  Medium                     |      Milestone:
Component:  Applications/Tor Launcher  |        Version:
 Severity:  Normal                     |     Resolution:
 Keywords:  TorBrowserTeam201708R      |  Actual Points:
Parent ID:                             |         Points:
 Reviewer:                             |        Sponsor:  Sponsor4
---------------------------------------+------------------------------
Changes (by dcf):

 * cc: dcf (added)


Comment:

 comment:1 looks like an effective workaround, but I suspect it can be
 addressed in a more direct way. I think the root of the problem is that
 progressMeter.value is reset to 0 every time the progress bar dialog is
 shown. I added some logging:
 {{{
 --- a/src/chrome/content/progress.js
 +++ b/src/chrome/content/progress.js
 @@ -51,6 +51,10 @@ function initDialog()
    }
    catch (e) {}

 +  var meter = document.getElementById("progressMeter");
 +  if (meter)
 +    TorLauncherLogger.log(6, "initDialog meter.value " + meter.value);
 +
    var isBrowserStartup = false;
    if (window.arguments)
    {
 @@ -181,9 +185,12 @@ var gObserver = {
        var labelText =
                  TorLauncherUtil.getLocalizedBootstrapStatus(statusObj,
 "TAG");
        var percentComplete = (statusObj.PROGRESS) ? statusObj.PROGRESS :
 0;
 +      TorLauncherLogger.log(6, "statusObj.PROGRESS " +
 statusObj.PROGRESS);

        var meter = document.getElementById("progressMeter");
 +      if (meter)
 +        TorLauncherLogger.log(6, "meter.value " + meter.value + " -> " +
 percentComplete);
        if (meter)
          meter.value = percentComplete;

        var bootstrapDidComplete = (percentComplete >= 100);
 }}}
 I hacked Browser/start-tor-browser to add `--jsconsole` to the command
 line so I could see the log output. Then I did this:
  1. `./start-tor-browser.desktop`
  2. Click "Open Settings" quickly before the bootstrap finishes.
  3. Wait a few seconds on the initial screen.
  4. Click "Connect" to make the progress bar reappear and let it finish
 bootstrapping.
 Step 4 of the above process shows the problem from #22266: even though the
 bootstrapping is really at ~90%, the progress bar goes back to 0% and then
 straight to 100% the second time the progress dialog is shown.

 Here is the log output:
 {{{
 [08-15 01:41:13] TorLauncher -: initDialog meter.value 0
 Tor NOTICE: Bootstrapped 85%: Finishing handshake with first hop
 [08-15 01:41:14] TorLauncher -: statusObj.PROGRESS 85
 [08-15 01:41:14] TorLauncher -: meter.value 0 -> 85
 Tor NOTICE: Bootstrapped 90%: Establishing a Tor circuit
 [08-15 01:41:14] TorLauncher -: statusObj.PROGRESS 90
 [08-15 01:41:14] TorLauncher -: meter.value 85 -> 90

   (Here is where I clicked "Open Settings", waited a few seconds, then
 clicked "Connect")

 [08-15 01:41:20] TorLauncher -: initDialog meter.value 0
 Tor NOTICE: Bootstrapped 100%: Done
 [08-15 01:41:21] TorLauncher -: statusObj.PROGRESS 100
 [08-15 01:41:21] TorLauncher -: meter.value 0 -> 100
 }}}
 Notice that when initDialog is called the second time, meter.value is
 reset to 0, rather than remembering its previous value of 90. Maybe this
 is because [https://gitweb.torproject.org/tor-
 launcher.git/tree/src/chrome/content/network-settings.js?h=0.2.12.3#n1252
 openProgressDialog] creates a brand new dialog from scratch? Perhaps
 instead, it could keep the same dialog in memory, and show or hide it as
 appropriate, so that meter.value retains its state.

 I ''don't'' think the usability problem from #22266 is an initial jump
 from 0% to 80%. That's normal and expected with an up-to-date consensus
 cache. Rather, the usability problem is when you cancel an in-progress
 bootstrapping at 60%, and when you resume, the meter goes down to 0% then
 back up to 65%. The changes in comment:1 make the bar invisible when it
 would misleadingly be set at 0%, but it would be better if the bar
 remembered its state and didn't go back to 0% at all.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23240#comment:2>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tbb-bugs mailing list