Verified Commit 22b986b8 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

fixup! Bug 40597: Implement TorSettings module

Bug 41114: Refactor TorConnect.

Do not await TorSettings.applySettings after a successfull bootstrap.
Instead, we use .catch and log any unexpected results.
parent 6bdd9dcd
Loading
Loading
Loading
Loading
+8 −1
Changes for toolkit/modules/TorConnect.sys.mjs: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -622,7 +622,14 @@ class AutoBootstrappingState extends StateCallback {
        // Persist the current settings to preferences.
        TorSettings.setSettings(currentSetting);
        TorSettings.saveToPrefs();
        await TorSettings.applySettings();
        // Do not await `applySettings`. Otherwise this opens up a window of
        // time where the user can still "Cancel" the bootstrap.
        // We are calling `applySettings` just to be on the safe side, but the
        // settings we are passing now should be exactly the same we already
        // passed earlier.
        TorSettings.applySettings().catch(e =>
          lazy.logger.error("TorSettings.applySettings threw unexpectedly.", e)
        );
        this.changeState(TorConnectState.Bootstrapped);
        return;
      }